Class jDaoGenerator

Description

This is a generator which creates php class from dao xml file.

It is called by jDaoCompiler

Located in /dao/jDaoGenerator.class.php (line 28)


	
			
Direct descendents
Class Description
sqliteDaoBuilder driver for jDaoCompiler
pgsqlDaoBuilder driver for jDaoCompiler
ociDaoBuilder driver for jDaoCompiler
mysqlDaoBuilder driver for jDaoCompiler
intuitionDaoBuilder driver for jDaoCompiler
Variable Summary
Method Summary
jDaoGenerator __construct ( $factoryClassName,  $recordClassName, jDaoParser $daoDefinition)
void buildClasses ()
void genOuterJoins ( &$tables,  $primaryTableName)
void genSelectPattern ( $pattern,  $table,  $fieldname,  $propname)
void genUpdateAutoIncrementPK ( $pkai,  $pTableRealName)
void getBooleanValue ( $value)
string _buildConditions (jDaoConditions $cond, array $fields, [array $params = array()], [boolean $withPrefix = true], [array $groupby = null])
string _buildSimpleConditions ( &$fields, [string $fieldPrefix = ''], [boolean $forSelect = true], array $fields)
string _buildSQLCondition ( $condition, array $fields, array $params, boolean $withPrefix, [boolean $principal = false], jDaoCondition $cond)
void _captureAll ( &$field)
void _captureFieldToUpdate ( &$field)
void _capturePkFields ( &$field)
void _capturePrimaryTable ( &$field)
void _encloseName ( $name)
void _getAutoIncrementPKField ([ $using = null])
array _getFromClause ()
void _getPropertiesBy ( $captureMethod)
void _getSelectClause ([ $distinct = false])
void _preparePHPExpr ( $expr,  $field, [ $checknull = true], [ $forCondition = ''])
void _preparePHPValue ( $value,  $fieldType, [ $checknull = true])
void _prepareValues ( $fieldList, [ $pattern = ''], [ $prefixfield = ''])
void _writeFieldNamesWith ([ $start = ''], [ $end = ''], [ $beetween = ''], [ $using = null])
void _writeFieldsInfoWith (string $info, [string $start = ''], [string $end = ''], [string $beetween = ''], [array $using = null])
Variables
mixed $aliasWord = ' AS ' (line 50)
  • access: protected

Redefined in descendants as:
mixed $falseValue = 0 (line 53)
  • access: protected

Redefined in descendants as:
mixed $trueValue = 1 (line 52)
  • access: protected

Redefined in descendants as:
string $_DaoClassName = null (line 46)

the DAO classname

  • access: protected
string $_DaoRecordClassName = null (line 40)

The DaoRecord ClassName

  • access: protected
jDaoParser $_datasParser = null (line 34)

the dao definition.

  • access: protected
Methods
Constructor __construct (line 59)

constructor

jDaoGenerator __construct ( $factoryClassName,  $recordClassName, jDaoParser $daoDefinition)
  • jDaoParser $daoDefinition
  • $factoryClassName
  • $recordClassName

Redefined in descendants as:
buildClasses (line 68)

build all classes

  • access: public
void buildClasses ()
genOuterJoins (line 467)
  • access: protected
void genOuterJoins ( &$tables,  $primaryTableName)
  • &$tables
  • $primaryTableName

Redefined in descendants as:
genSelectPattern (line 512)
  • access: protected
void genSelectPattern ( $pattern,  $table,  $fieldname,  $propname)
  • $pattern
  • $table
  • $fieldname
  • $propname

Redefined in descendants as:
genUpdateAutoIncrementPK (line 944)
  • access: protected
void genUpdateAutoIncrementPK ( $pkai,  $pTableRealName)
  • $pkai
  • $pTableRealName

Redefined in descendants as:
getBooleanValue (line 948)
  • access: protected
void getBooleanValue ( $value)
  • $value
_buildConditions (line 699)

build 'where' clause from conditions declared with condition tag in a user method

  • return: a WHERE clause (without the WHERE keyword) with eventually an ORDER clause
  • access: protected
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
_buildSimpleConditions (line 640)

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.

  • return: the WHERE clause (without the WHERE keyword)
  • access: protected
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
_buildSQLCondition (line 758)

build SQL WHERE clause

Used by _buildConditions. And this method call itself recursively

  • return: a WHERE clause (without the WHERE keyword)
  • see: jDaoGenerator::_buildConditions
  • access: protected
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
_captureAll (line 592)
  • access: protected
void _captureAll ( &$field)
  • &$field
_captureFieldToUpdate (line 596)
  • access: protected
void _captureFieldToUpdate ( &$field)
  • &$field
_capturePkFields (line 575)
  • access: protected
void _capturePkFields ( &$field)
  • &$field
_capturePrimaryFieldsExcludeAutoIncrement (line 579)
  • access: protected
void _capturePrimaryFieldsExcludeAutoIncrement ( &$field)
  • &$field
_capturePrimaryFieldsExcludePk (line 584)
  • access: protected
void _capturePrimaryFieldsExcludePk ( &$field)
  • &$field
_capturePrimaryTable (line 588)
  • access: protected
void _capturePrimaryTable ( &$field)
  • &$field
_encloseName (line 940)
  • access: protected
void _encloseName ( $name)
  • $name

Redefined in descendants as:
_getAutoIncrementPKField (line 609)

get autoincrement PK field

  • access: protected
void _getAutoIncrementPKField ([ $using = null])
  • $using

Redefined in descendants as:
_getFromClause (line 431)

create FROM clause for all SELECT query

  • return: FROM string and WHERE string
  • access: protected
array _getFromClause ()
_getPropertiesBy (line 563)

gets fields that match a condition returned by the $captureMethod

  • access: protected
void _getPropertiesBy ( $captureMethod)
  • $captureMethod
_getSelectClause (line 496)

build SELECT clause for all SELECT queries

  • access: protected
void _getSelectClause ([ $distinct = false])
  • $distinct
_preparePHPExpr (line 876)
  • access: protected
void _preparePHPExpr ( $expr,  $field, [ $checknull = true], [ $forCondition = ''])
  • $expr
  • $field
  • $checknull
  • $forCondition
_preparePHPValue (line 846)

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

  • access: protected
void _preparePHPValue ( $value,  $fieldType, [ $checknull = true])
  • $value
  • $fieldType
  • $checknull
_prepareValues (line 667)
  • access: protected
void _prepareValues ( $fieldList, [ $pattern = ''], [ $prefixfield = ''])
  • $fieldList
  • $pattern
  • $prefixfield
_writeFieldNamesWith (line 554)

format field names with start, end and between strings.

  • access: protected
void _writeFieldNamesWith ([ $start = ''], [ $end = ''], [ $beetween = ''], [ $using = null])
  • $start
  • $end
  • $beetween
  • $using
_writeFieldsInfoWith (line 537)

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

Documentation generated on Wed, 07 Sep 2011 13:46:58 +0200 by phpDocumentor 1.4.3