constructor
jDaoGenerator
__construct
(
$selector,
$tools,
$daoParser,
jDaoParser $daoDefinition)
-
jDaoParser
$daoDefinition
-
$selector
-
$tools
-
$daoParser
build all classes
void
buildClasses
()
build 'where' clause from conditions declared with condition tag in a user method
string
buildConditions
(
jDaoConditions $cond,
array $fields, [
array $params =
array()], [
boolean $withPrefix =
true], [
array $groupby =
null])
-
jDaoConditions
$cond: the condition object which contains conditions data
-
array
$fields: array of jDaoProperty
-
array
$params: list of parameters name of the method
-
boolean
$withPrefix: true if the field name should be preceded by the table name/table alias
-
array
$groupby: list of properties to use in a groupby
void
buildCountUserQuery
( $method, &$src, &$allField)
Redefined in descendants as:
void
buildDeleteUserQuery
( $method, &$src, &$primaryFields)
-
$method
-
&$src
-
&$primaryFields
void
buildEndOfClass
()
Redefined in descendants as:
create FROM clause and WHERE clause for all SELECT query
void
buildFromWhereClause
()
build the insert() method in the final class
string
buildInsertMethod
( $pkFields)
build a condition for the SQL WHERE clause.
this method call itself recursively.
string
buildOneSQLCondition
(
$condition,
array $fields,
array $params,
boolean $withPrefix, [
boolean $principal =
false],
jDaoCondition $cond)
-
jDaoCondition
$cond: a condition object which contains conditions data
-
array
$fields: array of jDaoProperty
-
array
$params: list of parameters name of the method
-
boolean
$withPrefix: true if the field name should be preceded by the table name/table alias
-
boolean
$principal: should be true for the first call, and false for recursive call
-
$condition
generates the part of the FROM clause for outer joins
array
buildOuterJoins
( &$tables, $primaryTableName)
-
&$tables
-
$primaryTableName
Redefined in descendants as:
build a SELECT clause for all SELECT queries
string
buildSelectClause
([ $distinct = false])
build an item for the select clause
void
buildSelectPattern
( $pattern, $table, $fieldname, $propname)
-
$pattern
-
$table
-
$fieldname
-
$propname
Redefined in descendants as:
void
buildSelectUserQuery
( $method, &$src, &$allField)
build a WHERE clause with conditions on given properties : conditions are equality between a variable and the field.
the variable name is the name of the property, made with an optional prefix given in $fieldPrefix parameter. This method is called to generate WHERE clause for primary keys.
string
buildSimpleConditions
( &$fields, [string $fieldPrefix = ''], [boolean $forSelect = true], array $fields)
-
array
$fields: list of jDaoPropery objects
-
string
$fieldPrefix: an optional prefix to prefix variable names
-
boolean
$forSelect: if true, the table name or table alias will prefix the field name in the query
-
&$fields
void
buildUpdateAutoIncrementPK
( $pkai)
Redefined in descendants as:
build the update() method for the final class
string
buildUpdateMethod
( $pkFields)
void
buildUpdateUserQuery
( $method, &$src, &$primaryFields)
-
$method
-
&$src
-
&$primaryFields
build all methods defined by the developer in the dao file
string
buildUserMethods
()
get autoincrement PK field
void
getAutoIncrementPKField
([ $using = null])
Redefined in descendants as:
void
_captureAll
( &$field)
void
_captureBinaryField
( &$field)
void
_captureFieldToUpdate
( &$field)
void
_captureFieldToUpdateOnUpdate
( &$field)
void
_capturePrimaryFieldsExcludeAutoIncrement
( &$field)
void
_capturePrimaryFieldsExcludePk
( &$field)
void
_capturePrimaryTable
( &$field)
void
_encloseName
( $name)
Redefined in descendants as:
void
_getPrimaryFieldsList
()
gets fields that match a condition returned by the $captureMethod
void
_getPropertiesBy
( $captureMethod)
void
_preparePHPCallbackExpr
( $field)
void
_preparePHPExpr
( $expr, $field, [ $checknull = true], [ $forCondition = ''])
-
$expr
-
$field
-
$checknull
-
$forCondition
void
_prepareValues
( $fieldList, [ $pattern = ''], [ $prefixfield = ''])
-
$fieldList
-
$pattern
-
$prefixfield
format field names with start, end and between strings.
void
_writeFieldNamesWith
([ $start = ''], [ $end = ''], [ $beetween = ''], [ $using = null])
-
$start
-
$end
-
$beetween
-
$using
format field names with start, end and between strings.
will write the field named info. eg info == name echo $field->name
void
_writeFieldsInfoWith
(string $info, [string $start = ''], [string $end = ''], [string $beetween = ''], [array $using = null])
-
string
$info: property to get from objects in $using
-
string
$start: string to add before the info
-
string
$end: string to add after the info
-
string
$beetween: string to add between each info
-
array
$using: list of CopixPropertiesForDAO object. if null, get default fields list