Class jDaoFactoryBase

Description

base class for all factory classes generated by the dao compiler

  • abstract:

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


	
			
Variable Summary
Method Summary
jDaoFactoryBase __construct (jDbConnection $conn)
int countAll ()
int countBy (jDaoConditions $searchcond)
int delete (string 0)
number deleteBy (jDaoConditions $searchcond)
jDbResultSet findBy (jDaoConditions $searchcond, [int $limitOffset = 0], [int $limitCount = 0])
jDaoRecordBase get (string 0)
array getProperties ()
void insert (jDaoRecordBase $record)
void update (jDaoRecordBase $record)
void _createConditionsClause ( $daocond, [ $forSelect = true])
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 98)
  • since: 1.0
  • access: protected
mixed $trueValue = 1 (line 94)
  • since: 1.0
  • access: protected
jDbConnection $_conn (line 46)

the database connector

  • access: protected
string $_DaoRecordClassName (line 66)

the class name of a dao record for this dao factory

  • access: protected
string $_daoSelector (line 72)

the selector of the dao, to be sent with events

  • access: protected
mixed $_deleteAfterEvent = false (line 81)
  • since: 1.0
  • access: protected
mixed $_deleteBeforeEvent = false (line 77)
  • since: 1.0
  • access: protected
mixed $_deleteByAfterEvent = false (line 89)
  • since: 1.0
  • access: protected
mixed $_deleteByBeforeEvent = false (line 85)
  • since: 1.0
  • access: protected
string $_fromClause (line 56)

the from clause you can reuse for a specific SELECT query

  • access: protected
string $_primaryTable (line 41)

the id of the primary table

  • access: protected
string $_selectClause (line 51)

the select clause you can reuse for a specific SELECT query

  • access: protected
array $_tables (line 36)

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

the where clause you can reuse for a specific SELECT query

  • access: protected
Methods
Constructor __construct (line 102)
jDaoFactoryBase __construct (jDbConnection $conn)
countAll (line 160)

return the number of all records

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

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

  • return: the count
  • author: Loic Mathaud
  • copyright: 2007 Loic Mathaud
  • since: 1.0b2
  • access: public
int countBy (jDaoConditions $searchcond)
delete (line 197)

delete a record corresponding to the given key

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

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

return all records

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

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)
get (line 172)

return the record corresponding to the given key

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

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

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
  'table' => 'grp', // alias of the table the property is attached to
  'updatePattern' => '%s',
  'insertPattern' => '%s',
  'selectPattern' => '%s',
  'sequenceName' => '', // name of the sequence when type is autoincrement
  'maxlength' => NULL, // or a number
  'minlength' => NULL, // or a number
  'ofPrimaryTable' => true/false,
  'needsQuotes' => tree/false, // says if the value need to enclosed between quotes
 )

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

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

save a modified record into the database

  • abstract:
  • access: public
void update (jDaoRecordBase $record)
_createConditionsClause (line 323)
  • access: protected
void _createConditionsClause ( $daocond, [ $forSelect = true])
  • $daocond
  • $forSelect
_createOrderClause (line 331)
  • access: protected
void _createOrderClause ( $daocond)
  • $daocond
_generateCondition (line 350)
  • access: protected
void _generateCondition ( $condition,  &$fields,  $forSelect, [ $principal = true])
  • $condition
  • &$fields
  • $forSelect
  • $principal
_getPkWhereClauseForNonSelect (line 318)

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

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

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, 07 Sep 2011 13:46:55 +0200 by phpDocumentor 1.4.3