Class jDaoFactoryBase

Description

base class for all factory classes generated by the dao compiler

  • abstract:

Located in /dao/jDaoFactoryBase.class.php (line 32)


	
			
Variable Summary
Method Summary
jDaoFactoryBase __construct (jDbConnection $conn)
int countAll ()
int countBy (jDaoConditions $searchcond, [ $distinct = null])
int delete (string $key)
number deleteBy (jDaoConditions $searchcond)
jDbResultSet findBy (jDaoConditions $searchcond, [int $limitOffset = 0], [int $limitCount = null])
jDaoRecordBase get (string $key)
array getProperties ()
void insert (jDaoRecordBase $record)
void update (jDaoRecordBase $record)
void _callbackBool ( $value)
void _callbackQuote ( $value)
void _callbackQuoteBin ( $value)
void _createConditionsClause ( $daocond, [ $forSelect = true])
void _createGroupClause ( $daocond)
void _createOrderClause ( $daocond)
void _generateCondition ( $condition,  &$fields,  $forSelect, [ $principal = true])
string _getPkWhereClauseForNonSelect (array $pk)
string _getPkWhereClauseForSelect (array $pk)
void _prepareValue ( $value,  $fieldType, [ $notNull = false])
Variables
mixed $falseValue = 0 (line 108)
  • since: 1.0
  • access: protected
mixed $trueValue = 1 (line 104)
  • since: 1.0
  • access: protected
jDbConnection $_conn (line 56)

the database connector

  • access: protected
string $_DaoRecordClassName (line 76)

the class name of a dao record for this dao factory

  • access: protected
string $_daoSelector (line 82)

the selector of the dao, to be sent with events

  • access: protected
mixed $_deleteAfterEvent = false (line 91)
  • since: 1.0
  • access: protected
mixed $_deleteBeforeEvent = false (line 87)
  • since: 1.0
  • access: protected
mixed $_deleteByAfterEvent = false (line 99)
  • since: 1.0
  • access: protected
mixed $_deleteByBeforeEvent = false (line 95)
  • since: 1.0
  • access: protected
string $_fromClause (line 66)

the from clause you can reuse for a specific SELECT query

  • access: protected
string $_primaryTable (line 51)

the id of the primary table

  • access: protected
string $_selectClause (line 61)

the select clause you can reuse for a specific SELECT query

  • access: protected
array $_tables (line 46)

informations on tables

Keys of elements are the alias of the table. values are arrays like that :

 array (
   'name' => ' the table alias',
   'realname' => 'the real name of the table',
   'pk' => array ( list of primary keys name ),
   'fields' => array ( list of property name attached to this table )
 )

  • access: protected
string $_whereClause (line 71)

the where clause you can reuse for a specific SELECT query

  • access: protected
Methods
Constructor __construct (line 112)
jDaoFactoryBase __construct (jDbConnection $conn)
countAll (line 171)

return the number of all records

  • return: the count
  • access: public
int countAll ()
countBy (line 280)

return the number of records corresponding to the conditions stored into the jDaoConditions object.

  • return: the count
  • author: Loic Mathaud
  • copyright: 2007 Loic Mathaud
  • contributor: Steven Jehannet
  • since: 1.0b2
  • access: public
int countBy (jDaoConditions $searchcond, [ $distinct = null])
delete (line 208)

delete a record corresponding to the given key

  • return: the number of deleted record
  • access: public
int delete (string $key)
  • string $key: one or more primary key
deleteBy (line 312)

delete all record corresponding to the conditions stored into the jDaoConditions object.

  • return: of deleted rows
  • since: 1.0beta3
  • access: public
number deleteBy (jDaoConditions $searchcond)
findAll (line 161)

return all records

  • access: public
jDbResultSet findAll ()
findBy (line 252)

return all record corresponding to the conditions stored into the jDaoConditions object.

you can limit the number of results by given an offset and a count

  • access: public
jDbResultSet findBy (jDaoConditions $searchcond, int $limitOffset, [int $limitCount = null])
finishInitResultSet (line 515)

finish to initialise a record set. Could be redefined in child class

to do additionnal processes

  • access: protected
void finishInitResultSet (jDbResultSet $rs)
get (line 183)

return the record corresponding to the given key

  • access: public
jDaoRecordBase get (string $key)
  • string $key: one or more primary key
getPrimaryKeyNames (line 155)

list of id of primary properties

  • return: list of properties name which contains primary keys
  • abstract:
  • since: 1.0beta3
  • access: public
array getPrimaryKeyNames ()
getProperties (line 148)

informations on all properties

keys are property name, and values are an array like that :

 array (
  'name' => 'name of property',
  'fieldName' => 'name of fieldname',
  'regExp' => NULL, // or the regular expression to test the value
  'required' => true/false,
  'isPK' => true/false, //says if it is a primary key
  'isFK' => true/false, //says if it is a foreign key
  'datatype' => '', // type of data : string
  'unifiedType'=> '' // the corresponding unified type
  'table' => 'grp', // alias of the table the property is attached to
  'updatePattern' => '%s',
  'insertPattern' => '%s',
  'selectPattern' => '%s',
  'sequenceName' => '', // name of the sequence when field is autoincrement
  'maxlength' => NULL, // or a number
  'minlength' => NULL, // or a number
  'ofPrimaryTable' => true/false
  'autoIncrement'=> true/false
 )

  • return: informations on all properties
  • abstract:
  • since: 1.0beta3
  • access: public
array getProperties ()
insert (line 235)

save a new record into the database

if the dao record has an autoincrement key, its corresponding property is updated

  • abstract:
  • access: public
void insert (jDaoRecordBase $record)
update (line 241)

save a modified record into the database

  • abstract:
  • access: public
void update (jDaoRecordBase $record)
_callbackBool (line 538)

a callback function for some array_map call in generated methods

  • access: protected
void _callbackBool ( $value)
  • $value
_callbackQuote (line 523)

a callback function for some array_map call in generated methods

  • since: 1.2
  • access: protected
void _callbackQuote ( $value)
  • $value
_callbackQuoteBin (line 531)

a callback function for some array_map call in generated methods

  • since: 1.2
  • access: protected
void _callbackQuoteBin ( $value)
  • $value
_createConditionsClause (line 350)
  • access: protected
void _createConditionsClause ( $daocond, [ $forSelect = true])
  • $daocond
  • $forSelect
_createGroupClause (line 376)
  • access: protected
void _createGroupClause ( $daocond)
  • $daocond
_createOrderClause (line 358)
  • access: protected
void _createOrderClause ( $daocond)
  • $daocond
_generateCondition (line 394)
  • access: protected
void _generateCondition ( $condition,  &$fields,  $forSelect, [ $principal = true])
  • $condition
  • &$fields
  • $forSelect
  • $principal
_getPkWhereClauseForNonSelect (line 345)

create a WHERE clause with conditions on primary keys with given value. This method should be used for DELETE and UPDATE queries.

  • return: a 'where' clause (WHERE mypk = 'myvalue' ...)
  • abstract:
  • access: protected
string _getPkWhereClauseForNonSelect (array $pk)
  • array $pk: associated array : keys = primary key name, values : value of a primary key
_getPkWhereClauseForSelect (line 337)

create a WHERE clause with conditions on primary keys with given value. This method should be used for SELECT queries. You haven't to escape values.

  • return: a 'where' clause (WHERE mypk = 'myvalue' ...)
  • abstract:
  • access: protected
string _getPkWhereClauseForSelect (array $pk)
  • array $pk: associated array : keys = primary key name, values : value of a primary key
_prepareValue (line 487)

prepare the value ready to be used in a dynamic evaluation

  • access: protected
void _prepareValue ( $value,  $fieldType, [ $notNull = false])
  • $value
  • $fieldType
  • $notNull

Documentation generated on Thu, 19 Sep 2013 00:03:12 +0200 by phpDocumentor 1.4.3