constructor
jDaoGenerator
__construct
(
$factoryClassName,
$recordClassName,
jDaoParser $daoDefinition)
-
jDaoParser
$daoDefinition
-
$factoryClassName
-
$recordClassName
Redefined in descendants as:
build all classes
void
buildClasses
()
void
genOuterJoins
( &$tables, $primaryTableName)
-
&$tables
-
$primaryTableName
Redefined in descendants as:
void
genSelectPattern
( $pattern, $table, $fieldname, $propname)
-
$pattern
-
$table
-
$fieldname
-
$propname
Redefined in descendants as:
void
genUpdateAutoIncrementPK
( $pkai, $pTableRealName)
Redefined in descendants as:
void
getBooleanValue
( $value)
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
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
build SQL WHERE clause
Used by _buildConditions. And this method call itself recursively
string
_buildSQLCondition
(
$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
void
_captureAll
( &$field)
void
_captureFieldToUpdate
( &$field)
void
_capturePkFields
( &$field)
void
_capturePrimaryFieldsExcludeAutoIncrement
( &$field)
void
_capturePrimaryFieldsExcludePk
( &$field)
void
_capturePrimaryTable
( &$field)
void
_encloseName
( $name)
Redefined in descendants as:
get autoincrement PK field
void
_getAutoIncrementPKField
([ $using = null])
Redefined in descendants as:
create FROM clause for all SELECT query
array
_getFromClause
()
gets fields that match a condition returned by the $captureMethod
void
_getPropertiesBy
( $captureMethod)
build SELECT clause for all SELECT queries
void
_getSelectClause
([ $distinct = false])
void
_preparePHPExpr
( $expr, $field, [ $checknull = true], [ $forCondition = ''])
-
$expr
-
$field
-
$checknull
-
$forCondition
prepare a string ready to be included in a PHP script
we assume that if the value is "NULL", all things has been take care of before the call of this method The method generates something like (including quotes) '.some PHP code.' (we do break "simple quoted strings")
void
_preparePHPValue
( $value, $fieldType, [ $checknull = true])
-
$value
-
$fieldType
-
$checknull
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