phpDocumentor openbiz.bin.data
[ class tree: openbiz.bin.data ] [ index: openbiz.bin.data ] [ all elements ]

Class: BizDataObj_Abstract

Source Location: /data/BizDataObj_Abstract.php

Class BizDataObj_Abstract

Direct descendents
Child Class Description
BizDataObj_Lite BizDataObj_Lite class - contains data object readonly functions

[ Top ]
Inherited Properties, Constants, and Methods
Property Summary
mixed   $m_AccessRule  
mixed   $m_BaseOtherSQLRule  
mixed   $m_BaseSearchRule  
mixed   $m_BaseSortRule  
mixed   $m_BizRecord  
mixed   $m_CacheLifeTime  
mixed   $m_Database  
mixed   $m_DeleteCondition  
mixed   $m_IdGeneration  
mixed   $m_InheritFrom  
mixed   $m_Limit  
mixed   $m_MainTable  
mixed   $m_MessageFile  
mixed   $m_Messages  
mixed   $m_ObjReferences  
mixed   $m_OtherSQLRule  
mixed   $m_Parameters  
mixed   $m_SearchRule  
mixed   $m_SortRule  
mixed   $m_Stateless  
mixed   $m_TableJoins  
mixed   $m_Uniqueness  
mixed   $m_UpdateCondition  

[ Top ]
Method Summary
void   __construct()   Initialize BizDataObj with xml array
void   ClearAllRules()   Reset all rules (search, sort, other SQL rule)
void   ClearOtherSQLRule()   Clear other SQL rule.
void   ClearSearchRule()   Clear search rule.
void   ClearSortRule()   Clear sort rule.
int   Count()   Count the number of record according to the search results set before.
boolean   DeleteRecord()   Delete current record or delete the given input record
array   DirectFetch()   Fetches SQL result rows as a sequential array without using query rules set before.
array   Fetch()   Fetches SQL result rows as a sequential array according the query rules set before.
PDOStatement   Find()   Do the search query and return results set as PDOStatement
protected   GetAssociation()   Get the Association
Zend_DB_Adapter   GetDBConnection()   Get database connection
string   GetMessage()   Get Message
string   GetParameter()   Get obejct parameter value
string   GetProperty()   Get the property of the object. Used in expression language
BizDataObj   GetRefObject()   Get the object instance defined in the object reference
void   GetSessionVars()   Get session variables
void   InheritParentObj()   Inherit from parent object. Name, Package, Class cannot be inherited
boolean   InsertRecord()   Insert record using given input record array
array   NewRecord()   Create an new (empty) record
void   ReadMetadata()   Read Metadata from xml array
void   ResetRules()   Reset rules
void   SetAssociation()   Set the association of the object
void   SetLimit()   Set limit of the query.
void   SetOtherSQLRule()   Set other SQL rule, append extra SQL statment in sql. i.e. GROUP BY [fieldName]
void   SetQueryParam()   Set query parameter for parameter binding in the query
void   SetSearchRule()   Set search rule as text in sql where clause. i.e. [fieldName] opr Value
void   SetSessionVars()   Set session variables
void   SetSortRule()   Set search rule as text in sql order by clause. i.e. [fieldName] DESC|ASC
boolean   UpdateRecord()   Update record using given input record array

[ Top ]
Properties
mixed   $m_AccessRule = null [line 42]
API Tags:
Access:  public


[ Top ]
mixed   $m_BaseOtherSQLRule = null [line 38]
API Tags:
Access:  public


[ Top ]
mixed   $m_BaseSearchRule = null [line 36]
API Tags:
Access:  public


[ Top ]
mixed   $m_BaseSortRule = null [line 37]
API Tags:
Access:  public


[ Top ]
mixed   $m_BizRecord = null [line 40]
API Tags:
Access:  public


[ Top ]
mixed   $m_CacheLifeTime = null [line 55]
API Tags:
Access:  public


[ Top ]
mixed   $m_Database [line 35]
API Tags:
Access:  public


[ Top ]
mixed   $m_DeleteCondition = null [line 44]
API Tags:
Access:  public


[ Top ]
mixed   $m_IdGeneration = null [line 45]
API Tags:
Access:  public


[ Top ]
mixed   $m_InheritFrom [line 41]
API Tags:
Access:  public


[ Top ]
mixed   $m_Limit = array() [line 58]
API Tags:
Access:  protected


[ Top ]
mixed   $m_MainTable = "" [line 39]
API Tags:
Access:  public


[ Top ]
mixed   $m_MessageFile = null [line 56]
API Tags:
Access:  public


[ Top ]
mixed   $m_Messages [line 59]
API Tags:
Access:  protected


[ Top ]
mixed   $m_ObjReferences = null [line 46]
API Tags:
Access:  public


[ Top ]
mixed   $m_OtherSQLRule = null [line 54]
API Tags:
Access:  public


[ Top ]
mixed   $m_Parameters = null [line 48]
API Tags:
Access:  public


[ Top ]
mixed   $m_SearchRule = null [line 52]
API Tags:
Access:  public


[ Top ]
mixed   $m_SortRule = null [line 53]
API Tags:
Access:  public


[ Top ]
mixed   $m_Stateless = null [line 49]
API Tags:
Access:  public


[ Top ]
mixed   $m_TableJoins = null [line 47]
API Tags:
Access:  public


[ Top ]
mixed   $m_Uniqueness = null [line 50]
API Tags:
Access:  public


[ Top ]
mixed   $m_UpdateCondition = null [line 43]
API Tags:
Access:  public


[ Top ]
Methods
Constructor __construct  [line 67]

  void __construct( array &$xmlArr  )

Initialize BizDataObj with xml array

Parameters:
array   $xmlArr: 


Redefinition of:
MetaObject::__construct()

Redefined in descendants as:

[ Top ]
ClearAllRules  [line 234]

  void ClearAllRules( )

Reset all rules (search, sort, other SQL rule)


API Tags:
Access:  public


[ Top ]
ClearOtherSQLRule  [line 223]

  void ClearOtherSQLRule( )

Clear other SQL rule.

Reset the other SQL rule to default other SQL rule set in metadata


API Tags:
Access:  public


[ Top ]
ClearSearchRule  [line 200]

  void ClearSearchRule( )

Clear search rule.

Reset the search rule to default search rule set in metadata


API Tags:
Access:  public


[ Top ]
ClearSortRule  [line 211]

  void ClearSortRule( )

Clear sort rule.

Reset the sort rule to default sort rule set in metadata


API Tags:
Access:  public


[ Top ]
Count  [line 511]

  int Count( )

Count the number of record according to the search results set before.

it ignores limit setting


API Tags:
Return:  number of records
Access:  public
Abstract:  


Redefined in descendants as:

[ Top ]
DeleteRecord  [line 449]

  boolean DeleteRecord( array $recArr  )

Delete current record or delete the given input record

Parameters:
array   $recArr:  - associated array whose keys are field names of this BizDataObj

API Tags:
Return:  - if return false, the caller can call GetErrorMessage to get the error.
Access:  public
Abstract:  


Redefined in descendants as:

[ Top ]
DirectFetch  [line 482]

  array DirectFetch( [string $searchRule = ""], [int $count = -1], [int $offset = 0]  )

Fetches SQL result rows as a sequential array without using query rules set before.

sample code: // fetch all record with firstname starting with Mike $do->DirectFetch("[FirstName] LIKE 'Mike%'"); // fetch first 10 records with firstname starting with Mike $do->DirectFetch("[FirstName] LIKE 'Mike%'", 10); // fetch 20th-30th records with firstname starting with Mike $do->DirectFetch("[FirstName] LIKE 'Mike%'", 10, 20);

Parameters:
string   $searchRule:  the search rule string
int   $count:  number of records to return
int   $offset:  the starting point of the return records

API Tags:
Return:  array of records
Access:  public
Abstract:  


Redefined in descendants as:

[ Top ]
Fetch  [line 465]

  array Fetch( )

Fetches SQL result rows as a sequential array according the query rules set before.

sample code: $do->ResetRules(); $do->SetSearchRule($search_rule1); $do->SetSearchRule($search_rule2); $do->SetSortRule($sort_rule); $do->SetOtherRule($groupby); $total = $do->Count(); $do->SetLimit($count, $offset=0); $recordSet = $do->Fetch();


API Tags:
Return:  array of records
Access:  public
Abstract:  


Redefined in descendants as:

[ Top ]
Find  [line 503]

  PDOStatement Find( )

Do the search query and return results set as PDOStatement

sample code: $do->ResetRules(); $do->SetSearchRule($search_rule1); $do->SetSearchRule($search_rule2); $do->SetSortRule($sort_rule); $do->SetOtherRule($groupby); $total = $do->Count(); $do->SetLimit($count, $offset=0); $resultSet = $do->Find(); $do->GetDBConnection()->setFetchMode(PDO::FETCH_ASSOC); while ($record = $resultSet->fetch()) { print_r($record); }


API Tags:
Return:  PDO statement object
Access:  public
Abstract:  


Redefined in descendants as:

[ Top ]
GetAssociation  [line 389]

  protected GetAssociation( )

Get the Association


API Tags:
Return:  m_Association
Access:  public


[ Top ]
GetDBConnection  [line 318]

  Zend_DB_Adapter GetDBConnection( )

Get database connection


API Tags:
Access:  public


[ Top ]
GetMessage  [line 159]

  string GetMessage( $msgid, [array $params = array()]  )

Get Message

Parameters:
   $msgid:  message Id
array   $params: 

API Tags:
Access:  protected


[ Top ]
GetParameter  [line 357]

  string GetParameter( string $paramName  )

Get obejct parameter value

Parameters:
string   $paramName:  name of the parameter

API Tags:
Return:  parameter value
Access:  public


[ Top ]
GetProperty  [line 330]

  string GetProperty( string $propertyName  )

Get the property of the object. Used in expression language

Parameters:
string   $propertyName:  name of the property

API Tags:
Return:  property value
Access:  public


Redefinition of:
MetaObject::GetProperty()
Get property

[ Top ]
GetRefObject  [line 368]

  BizDataObj GetRefObject( string $objName  )

Get the object instance defined in the object reference

Parameters:
string   $objName:  the object name list in the ObjectReference part

API Tags:
Return:  object instance
Access:  public


[ Top ]
GetSessionVars  [line 171]

  void GetSessionVars( SessionContext $sessCtxt  )

Get session variables

Parameters:
SessionContext   $sessCtxt:  sessCtxt

API Tags:
Access:  public


Redefined in descendants as:

[ Top ]
InheritParentObj  [line 124]

  void InheritParentObj( )

Inherit from parent object. Name, Package, Class cannot be inherited


API Tags:
Access:  protected


[ Top ]
InsertRecord  [line 432]

  boolean InsertRecord( array $recArr  )

Insert record using given input record array

Parameters:
array   $recArr:  - associated array whose keys are field names of this BizDataObj

API Tags:
Return:  - if return false, the caller can call GetErrorMessage to get the error.
Access:  public
Abstract:  


Redefined in descendants as:

[ Top ]
NewRecord  [line 424]

  array NewRecord( )

Create an new (empty) record


API Tags:
Return:  - empty record array with default values
Access:  public
Abstract:  


Redefined in descendants as:

[ Top ]
ReadMetadata  [line 79]

  void ReadMetadata( array &$xmlArr  )

Read Metadata from xml array

Parameters:
array   $xmlArr: 

API Tags:
Access:  protected


[ Top ]
ResetRules  [line 187]

  void ResetRules( )

Reset rules


API Tags:
Access:  public


[ Top ]
SetAssociation  [line 401]

  void SetAssociation( ObjReference $objRef, BizDataObj $asscObj  )

Set the association of the object

Parameters:
ObjReference   $objRef: 
BizDataObj   $asscObj: 

API Tags:
Access:  protected


[ Top ]
SetLimit  [line 307]

  void SetLimit( int $count, [int $offset = 0]  )

Set limit of the query.

Parameters:
int   $count:  the number of records to return
int   $offset:  the starting position of the result records

API Tags:
Access:  public


[ Top ]
SetOtherSQLRule  [line 294]

  void SetOtherSQLRule( string $rule  )

Set other SQL rule, append extra SQL statment in sql. i.e. GROUP BY [fieldName]

Parameters:
string   $rule:  search rule with SQL format "GROUP BY [fieldName] HAVING ..."

API Tags:
Access:  public


[ Top ]
SetQueryParam  [line 269]

  void SetQueryParam( string $queryStr, array $paramValues  )

Set query parameter for parameter binding in the query

Parameters:
string   $queryStr: 
array   $paramValues: 

API Tags:
Access:  public


[ Top ]
SetSearchRule  [line 249]

  void SetSearchRule( string $rule, [boolean $overwrite = false]  )

Set search rule as text in sql where clause. i.e. [fieldName] opr Value

Parameters:
string   $rule:  search rule has format "[fieldName] opr Value"
boolean   $overwrite:  specify if this rule should overwrite any existing rule

API Tags:
Access:  public


[ Top ]
SetSessionVars  [line 179]

  void SetSessionVars( SessionContext $sessCtxt  )

Set session variables

Parameters:
SessionContext   $sessCtxt:  sessCtxt

API Tags:
Access:  public


Redefined in descendants as:

[ Top ]
SetSortRule  [line 282]

  void SetSortRule( string $rule  )

Set search rule as text in sql order by clause. i.e. [fieldName] DESC|ASC

Parameters:
string   $rule:  sort rule has format "[fieldName] DESC|ASC"

API Tags:
Access:  public


[ Top ]
UpdateRecord  [line 441]

  boolean UpdateRecord( array $recArr, [array $oldRec = null]  )

Update record using given input record array

Parameters:
array   $recArr:  - associated array whose keys are field names of this BizDataObj
array   $oldRec:  - associated array who is the old record field name / value pairs

API Tags:
Return:  - if return false, the caller can call GetErrorMessage to get the error.
Access:  public
Abstract:  


Redefined in descendants as:

[ Top ]

Documentation generated on Tue, 22 Dec 2009 03:02:33 -0800 by phpDocumentor 1.3.0RC3