[ Index ] |
|
Code source de Symfony 1.0.0 |
[Code source] [Imprimer] [Statistiques]
(pas de description)
Poids: | 1273 lignes (39 kb) |
Inclus ou requis: | 0 fois |
Référencé: | 0 fois |
Nécessite: | 0 fichiers |
PHP5ComplexObjectBuilder:: (46 méthodes):
addAttributes()
addClassBody()
addMutatorClose()
addManipulationMethods()
addValidationMethods()
getForeignTable()
getFKPhpNameAffix()
getRefFKPhpNameAffix()
getRelatedBySuffix()
getFKVarName()
getRefFKCollVarName()
getRefFKLastCriteriaVarName()
addFKMethods()
addFKAttributes()
addFKMutator()
set()
addFKAccessor()
get()
addFKByKeyMutator()
set()
addRefFKGetJoinMethods()
get()
addRefFKAttributes()
addRefFKMethods()
addRefFKInit()
init()
addRefFKAdd()
add()
addRefFKCount()
count()
addRefFKGet()
get()
addDoSave()
doSave()
addAlreadyInSaveAttribute()
addSave()
save()
addAlreadyInValidationAttribute()
addValidate()
validate()
addDoValidate()
doValidate()
addCopy()
copy()
addCopyInto()
copyInto()
Classe: PHP5ComplexObjectBuilder - X-Ref
Generates a PHP5 base Object class with complex object model methods.addAttributes(&$script) X-Ref |
Adds additional attributes used for complex object model. param: string &$script The script will be modified in this method. |
addClassBody(&$script) X-Ref |
Specifies the methods that are added as part of the basic OM class. This can be overridden by subclasses that wish to add more methods. param: string &$script The script will be modified in this method. |
addMutatorClose(&$script, Column $col) X-Ref |
Adds the close of mutator (setter) method for a column. This method overrides the method from PHP5BasicObjectBuilder in order to account for updating related objects. param: string &$script The script will be modified in this method. param: Column $col The current column. |
addManipulationMethods(&$script) X-Ref |
Adds the methods related to validating, saving and deleting the object. param: string &$script The script will be modified in this method. |
addValidationMethods(&$script) X-Ref |
Adds the methods related to validationg the object. param: string &$script The script will be modified in this method. |
getForeignTable(ForeignKey $fk) X-Ref |
Convenience method to get the foreign Table object for an fkey. return: Table |
getFKPhpNameAffix(ForeignKey $fk, $plural = false) X-Ref |
Gets the PHP method name affix to be used for fkeys for the current table (not referrers to this table). The difference between this method and the getRefFKPhpNameAffix() method is that in this method the classname in the affix is the foreign table classname. param: ForeignKey $fk The local FK that we need a name for. param: boolean $plural Whether the php name should be plural (e.g. initRelatedObjs() vs. addRelatedObj() return: string |
getRefFKPhpNameAffix(ForeignKey $fk, $plural = false) X-Ref |
Gets the PHP method name affix to be used for referencing foreign key methods and variable names (e.g. set????(), $coll???). The difference between this method and the getFKPhpNameAffix() method is that in this method the classname in the affix is the classname of the local fkey table. param: ForeignKey $fk The referrer FK that we need a name for. param: boolean $plural Whether the php name should be plural (e.g. initRelatedObjs() vs. addRelatedObj() return: string |
getRelatedBySuffix(ForeignKey $fk) X-Ref |
Gets the "RelatedBy*" suffix (if needed) that is attached to method and variable names. The related by suffix is based on the local columns of the foreign key. If there is more than one column in a table that points to the same foreign table, then a 'RelatedByLocalColName' suffix will be appended. return: string |
getFKVarName(ForeignKey $fk) X-Ref |
Pas de description |
getRefFKCollVarName(ForeignKey $fk) X-Ref |
Pas de description |
getRefFKLastCriteriaVarName(ForeignKey $fk) X-Ref |
Pas de description |
addFKMethods(&$script) X-Ref |
Adds the methods that get & set objects related by foreign key to the current object. param: string &$script The script will be modified in this method. |
addFKAttributes(&$script, ForeignKey $fk) X-Ref |
Adds the class attributes that are needed to store fkey related objects. param: string &$script The script will be modified in this method. |
addFKMutator(&$script, ForeignKey $fk) X-Ref |
Adds the mutator (setter) method for setting an fkey related object. param: string &$script The script will be modified in this method. |
set({";foreach ($fk->getLocalColumns() X-Ref |
Declares an association between this object and a $className object. param: $className \$v return: void |
addFKAccessor(&$script, ForeignKey $fk) X-Ref |
Adds the accessor (getter) method for getting an fkey related object. param: string &$script The script will be modified in this method. |
get({include_once '".$fkPeerBuilder->getClassFilePath() X-Ref |
Get the associated $className object param: Connection Optional Connection object. return: $className The associated $className object. |
addFKByKeyMutator(&$script, ForeignKey $fk) X-Ref |
Adds a convenience method for setting a related object by specifying the primary key. This can be used in conjunction with the getPrimaryKey() for systems where nothing is known about the actual objects being related. param: string &$script The script will be modified in this method. |
set({";if (count($fk->getLocalColumns() X-Ref |
Provides convenient way to set a relationship based on a key. e.g. <code>\$bar->setFooKey(\$foo->getPrimaryKey())</code> "; Note: It is important that the xml schema used to create this class maintains consistency in the order of related columns between ".$table->getName()." and ". $tblFK->getName().". If for some reason this is impossible, this method should be overridden in <code>".$table->getPhpName()."</code>."; return: void |
addRefFKGetJoinMethods(&$script, ForeignKey $refFK) X-Ref |
Adds the method that fetches fkey-related (referencing) objects but also joins in data from another table. param: string &$script The script will be modified in this method. |
get({include_once '".$fkPeerBuilder->getClassFilePath() X-Ref |
If this collection has already been initialized with an identical criteria, it returns the collection. Otherwise if this ".$table->getPhpName()." is new, it will return an empty collection; or if this ".$table->getPhpName()." has previously been saved, it will retrieve related $relCol from storage. This method is protected by default in order to keep the public api reasonable. You can provide public methods for those you actually need in ".$table->getPhpName().". |
addRefFKAttributes(&$script, ForeignKey $refFK) X-Ref |
Adds the attributes used to store objects that have referrer fkey relationships to this object. <code>protected collVarName;</code> <code>private lastVarNameCriteria = null;</code> param: string &$script The script will be modified in this method. |
addRefFKMethods(&$script) X-Ref |
Adds the methods for retrieving, initializing, adding objects that are related to this one by foreign keys. param: string &$script The script will be modified in this method. |
addRefFKInit(&$script, ForeignKey $refFK) X-Ref |
Adds the method that initializes the referrer fkey collection. param: string &$script The script will be modified in this method. |
init({if (\$this->$collName === null) X-Ref |
Temporary storage of $collName to save a possible db hit in the event objects are add to the collection, but the complete collection is never requested. return: void |
addRefFKAdd(&$script, ForeignKey $refFK) X-Ref |
Adds the method that adds an object into the referrer fkey collection. param: string &$script The script will be modified in this method. |
add({\$this->coll".$this->getRefFKPhpNameAffix($refFK, $plural = true) X-Ref |
Method called to associate a ".$tblFK->getPhpName()." object to this object through the $className foreign key attribute param: $className \$l $className return: void |
addRefFKCount(&$script, ForeignKey $refFK) X-Ref |
Adds the method that returns the size of the referrer fkey collection. param: string &$script The script will be modified in this method. |
count({include_once '".$fkPeerBuilder->getClassFilePath() X-Ref |
Returns the number of related $relCol. param: Criteria \$criteria param: boolean \$distinct param: Connection \$con |
addRefFKGet(&$script, ForeignKey $refFK) X-Ref |
Adds the method that returns the referrer fkey collection. param: string &$script The script will be modified in this method. |
get({include_once '".$fkPeerBuilder->getClassFilePath() X-Ref |
If this collection has already been initialized with an identical criteria, it returns the collection. Otherwise if this ".$table->getPhpName()." has previously been saved, it will retrieve related $relCol from storage. If this ".$table->getPhpName()." is new, it will return an empty collection or the current collection, the criteria is ignored on a new object. param: Connection \$con param: Criteria \$criteria |
addDoSave(&$script) X-Ref |
Adds the workhourse doSave() method. param: string &$script The script will be modified in this method. |
doSave(\$con) X-Ref |
Stores the object in the database. If the object is new, it inserts it; otherwise an update is performed. All related objects are also updated in this method. param: Connection \$con return: int The number of rows affected by this insert/update and any referring fk objects' save() operations. |
addAlreadyInSaveAttribute(&$script) X-Ref |
Adds the $alreadyInSave attribute, which prevents attempting to re-save the same object. param: string &$script The script will be modified in this method. |
addSave(&$script) X-Ref |
Adds the save() method. param: string &$script The script will be modified in this method. |
save(\$con = null) X-Ref |
Stores the object in the database. If the object is new, it inserts it; otherwise an update is performed. This method wraps the doSave() worker method in a transaction. param: Connection \$con return: int The number of rows affected by this insert/update and any referring fk objects' save() operations. |
addAlreadyInValidationAttribute(&$script) X-Ref |
Adds the $alreadyInValidation attribute, which prevents attempting to re-validate the same object. param: string &$script The script will be modified in this method. |
addValidate(&$script) X-Ref |
Adds the validate() method. param: string &$script The script will be modified in this method. |
validate(\$columns = null) X-Ref |
Validates the objects modified field values and all objects related to this table. If \$columns is either a column name or an array of column names only those columns are validated. param: mixed \$columns Column name or an array of column names. return: boolean Whether all columns pass validation. |
addDoValidate(&$script) X-Ref |
Adds the workhourse doValidate() method. param: string &$script The script will be modified in this method. |
doValidate(\$columns = null) X-Ref |
This function performs the validation work for complex object models. In addition to checking the current object, all related objects will also be validated. If all pass then <code>true</code> is returned; otherwise an aggreagated array of ValidationFailed objects will be returned. param: array \$columns Array of column names to validate. return: mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objets otherwise. |
addCopy(&$script) X-Ref |
Adds the copy() method, which (in complex OM) includes the $deepCopy param for making copies of related objects. param: string &$script The script will be modified in this method. |
copy(\$deepCopy = false) X-Ref |
Makes a copy of this object that will be inserted as a new row in table when saved. It creates a new object filling in the simple attributes, but skipping any primary keys that are defined for the table. If desired, this method can also make copies of all associated (fkey referrers) objects. param: boolean \$deepCopy Whether to also copy all rows that refer (by fkey) to the current row. return: ".$table->getPhpName()." Clone of current object. |
addCopyInto(&$script) X-Ref |
Adds the copyInto() method, which takes an object and sets contents to match current object. In complex OM this method includes the $deepCopy param for making copies of related objects. param: string &$script The script will be modified in this method. |
copyInto(\$copyObj, \$deepCopy = false) X-Ref |
Sets contents of passed object to values from current object. If desired, this method can also make copies of all associated (fkey referrers) objects. param: object \$copyObj An object of ".$table->getPhpName()." (or compatible) type. param: boolean \$deepCopy Whether to also copy all rows that refer (by fkey) to the current row. |
Généré le : Fri Mar 16 22:42:14 2007 | par Balluche grâce à PHPXref 0.7 |