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)
string getPrimaryTable ()
array getProperties ()
array getTables ()
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 188)

return the number of all records

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

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 225)

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 329)

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 178)

return all records

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

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 536)

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

to do additionnal processes

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

return the record corresponding to the given key

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

list of id of primary properties

  • return: list of properties name which contains primary keys
  • abstract:
  • since: 1.0beta3
  • access: public
array getPrimaryKeyNames ()
getPrimaryTable (line 135)
  • return: the id (alias or realname) of the primary table
  • since: 1.3.2
  • access: public
string getPrimaryTable ()
getProperties (line 165)

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 ()
getTables (line 127)
array getTables ()
insert (line 252)

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 258)

save a modified record into the database

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

a callback function for some array_map call in generated methods

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

a callback function for some array_map call in generated methods

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

a callback function for some array_map call in generated methods

  • since: 1.2
  • access: protected
void _callbackQuoteBin ( $value)
  • $value
_createConditionsClause (line 367)
  • access: protected
void _createConditionsClause ( $daocond, [ $forSelect = true])
  • $daocond
  • $forSelect
_createGroupClause (line 393)
  • access: protected
void _createGroupClause ( $daocond)
  • $daocond
_createOrderClause (line 375)
  • access: protected
void _createOrderClause ( $daocond)
  • $daocond
_generateCondition (line 411)
  • access: protected
void _generateCondition ( $condition,  &$fields,  $forSelect, [ $principal = true])
  • $condition
  • &$fields
  • $forSelect
  • $principal
_getPkWhereClauseForNonSelect (line 362)

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 354)

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 508)

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 Wed, 24 Sep 2014 21:57:13 +0200 by phpDocumentor 1.4.3