[ Index ]
 

Code source de Symfony 1.0.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/vendor/propel-generator/classes/propel/engine/builder/om/php5/ -> PHP5BasicObjectBuilder.php (sommaire)

(pas de description)

Poids: 1392 lignes (38 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

PHP5BasicObjectBuilder:: (70 méthodes):
  getPackage()
  getClassname()
  addIncludes()
  addClassOpen()
  addClassBody()
  addClassClose()
  addConstants()
  addAttributes()
  addColumnAttributes()
  addGetPeer()
  getPeer()
  addTemporalAccessor()
  get()
  addGenericAccessor()
  get()
  addLazyLoader()
  load()
  addMutatorOpen()
  set()
  addMutatorClose()
  addLobMutator()
  addTemporalMutator()
  addDefaultMutator()
  addHydrate()
  hydrate()
  addBuildPkeyCriteria()
  buildPkeyCriteria()
  addBuildCriteria()
  buildCriteria()
  addToArray()
  toArray()
  addGetByName()
  getByName()
  addGetByPosition()
  getByPosition()
  addSetByName()
  setByName()
  addSetByPosition()
  setByPosition()
  addFromArray()
  fromArray()
  addDelete()
  delete()
  addManipulationMethods()
  addValidationMethods()
  addSave()
  save()
  addValidationFailuresAttribute()
  addValidate()
  validate()
  addGetValidationFailures()
  getValidationFailures()
  addGetPrimaryKey()
  addGetPrimaryKey_SinglePK()
  getPrimaryKey()
  addGetPrimaryKey_MultiPK()
  getPrimaryKey()
  addGetPrimaryKey_NoPK()
  getPrimaryKey()
  addSetPrimaryKey()
  addSetPrimaryKey_SinglePK()
  setPrimaryKey()
  addSetPrimaryKey_MultiPK()
  setPrimaryKey()
  addSetPrimaryKey_NoPK()
  setPrimaryKey()
  addCopy()
  copy()
  addCopyInto()
  copyInto()


Classe: PHP5BasicObjectBuilder  - X-Ref

Generates a PHP5 base Object class for user object model (OM).

This class produces the base object class (e.g. BaseMyTable) which contains all
the custom-built accessor and setter methods.

This class replaces the Object.tpl, with the intent of being easier for users
to customize (through extending & overriding).

getPackage()   X-Ref
Gets the package for the [base] object classes.

return: string

getClassname()   X-Ref
Returns the name of the current class being built.

return: string

addIncludes(&$script)   X-Ref
Adds the include() statements for files that this class depends on or utilizes.

param: string &$script The script will be modified in this method.

addClassOpen(&$script)   X-Ref
Adds class phpdoc comment and openning of class.

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.


addClassClose(&$script)   X-Ref
Closes class.

param: string &$script The script will be modified in this method.

addConstants(&$script)   X-Ref
Adds any constants to the class.

param: string &$script The script will be modified in this method.

addAttributes(&$script)   X-Ref
Adds class attributes.

param: string &$script The script will be modified in this method.

addColumnAttributes(&$script)   X-Ref
Adds variables that store column values.

param: string &$script The script will be modified in this method.

addGetPeer(&$script)   X-Ref
Adds the getPeer() method.
This is a convenient, non introspective way of getting the Peer class for a particular object.

param: string &$script The script will be modified in this method.

getPeer()   X-Ref
Returns a peer instance associated with this om.

Since Peer classes are not to have any instance attributes, this method returns the
same instance for all member of this class. The method could therefore
be static, but this would prevent one from overriding the behavior.

return: ".$this->getPeerClassname()."

addTemporalAccessor(&$script, $col)   X-Ref
Adds a date/time/timestamp getter method.

param: string &$script The script will be modified in this method.
param: Column $col The current column.

get(if ($col->isLazyLoad()   X-Ref
Get the [optionally formatted] [$clo] column value.
".$col->getDescription()."

param: string \$format The date/time format string (either date()-style or strftime()-style).
return: mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).

addGenericAccessor(&$script, $col)   X-Ref
Adds a normal (non-temporal) getter method.

param: string &$script The script will be modified in this method.
param: Column $col The current column.

get(if ($col->isLazyLoad()   X-Ref
Get the [$clo] column value.
".$col->getDescription()."

return: ".$col->getPhpNative()."

addLazyLoader(&$script, $col)   X-Ref
Adds the lazy loader method.

param: string &$script The script will be modified in this method.
param: Column $col The current column.

load({\$c = \$this->buildPkeyCriteria()   X-Ref
Load the value for the lazy-loaded [$clo] column.

This method performs an additional query to return the value for
the [$clo] column, since it is not populated by
the hydrate() method.

param: \$con Connection
return: void

addMutatorOpen(&$script, Column $col)   X-Ref
Adds the open of the mutator (setter) method for a column.

param: string &$script The script will be modified in this method.
param: Column $col The current column.

set({";if ($col->isLazyLoad()   X-Ref
Set the value of [$clo] column.
".$col->getDescription()."

param: ".$col->getPhpNative()." \$v new value
return: void

addMutatorClose(&$script, Column $col)   X-Ref
Adds the close of the mutator (setter) method for a column.
This can be overridden (e.g. by PHP5ComplexObjectBuilder) if additional functionality is needed.

param: string &$script The script will be modified in this method.
param: Column $col The current column.

addLobMutator(&$script, Column $col)   X-Ref
Adds a setter for date/time/timestamp columns.

param: string &$script The script will be modified in this method.
param: Column $col The current column.

addTemporalMutator(&$script, Column $col)   X-Ref
Adds a setter method for date/time/timestamp columns.

param: string &$script The script will be modified in this method.
param: Column $col The current column.

addDefaultMutator(&$script, Column $col)   X-Ref
Adds setter method for "normal" columns.

param: string &$script The script will be modified in this method.
param: Column $col The current column.

addHydrate(&$script)   X-Ref
Adds the hydrate() method, which sets attributes of the object based on a ResultSet.


hydrate(ResultSet \$rs, \$startcol = 1)   X-Ref
Hydrates (populates) the object variables with values from the database resultset.

An offset (1-based \"start column\") is specified so that objects can be hydrated
with a subset of the columns in the resultset rows.  This is needed, for example,
for results of JOIN queries where the resultset row includes columns from two or
more tables.

param: ResultSet \$rs The ResultSet class with cursor advanced to desired record pos.
param: int \$startcol 1-based offset column which indicates which restultset column to start with.
return: int next starting column

addBuildPkeyCriteria(&$script)   X-Ref
Pas de description

buildPkeyCriteria()   X-Ref
Builds a Criteria object containing the primary key for this object.

Unlike buildCriteria() this method includes the primary key values regardless
of whether or not they have been modified.

return: Criteria The Criteria object containing value(s) for primary key(s).

addBuildCriteria(&$script)   X-Ref
Pas de description

buildCriteria()   X-Ref
Build a Criteria object containing the values of all modified columns in this object.

return: Criteria The Criteria object containing all modified values.

addToArray(&$script)   X-Ref
Pas de description

toArray(\$keyType = BasePeer::TYPE_PHPNAME)   X-Ref
Exports the object as an array.

You can specify the key type of the array by passing one of the class
type constants.

param: string \$keyType One of the class type constants TYPE_PHPNAME,
return: an associative array containing the field names (as keys) and field values

addGetByName(&$script)   X-Ref
Pas de description

getByName(\$name, \$type = BasePeer::TYPE_PHPNAME)   X-Ref
Retrieves a field from the object by name passed in as a string.

param: string \$name name
param: string \$type The type of fieldname the \$name is of:
return: mixed Value of field.

addGetByPosition(&$script)   X-Ref
Pas de description

getByPosition(\$pos)   X-Ref
Retrieves a field from the object by Position as specified in the xml schema.
Zero-based.

param: int \$pos position in xml schema
return: mixed Value of field at \$pos

addSetByName(&$script)   X-Ref
Pas de description

setByName(\$name, \$value, \$type = BasePeer::TYPE_PHPNAME)   X-Ref
Sets a field from the object by name passed in as a string.

param: string \$name peer name
param: mixed \$value field value
param: string \$type The type of fieldname the \$name is of:
return: void

addSetByPosition(&$script)   X-Ref
Pas de description

setByPosition(\$pos, \$value)   X-Ref
Sets a field from the object by Position as specified in the xml schema.
Zero-based.

param: int \$pos position in xml schema
param: mixed \$value field value
return: void

addFromArray(&$script)   X-Ref
Pas de description

fromArray(\$arr, \$keyType = BasePeer::TYPE_PHPNAME)   X-Ref
Populates the object using an array.

This is particularly useful when populating an object from one of the
request arrays (e.g. \$_POST).  This method goes through the column
names, checking to see whether a matching key exists in populated
array. If so the setByName() method is called for that column.

You can specify the key type of the array by additionally passing one
of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')

param: array  \$arr     An array to populate the object from.
param: string \$keyType The type of keys the array uses.
return: void

addDelete(&$script)   X-Ref
Pas de description

delete(\$con = null)   X-Ref
Removes this object from datastore and sets delete attribute.

param: Connection \$con
return: void

addManipulationMethods(&$script)   X-Ref
Adds the methods related to 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.

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.

param: Connection \$con
return: int The number of rows affected by this insert/update operation (for non-complex OM this will be at most 1).

addValidationFailuresAttribute(&$script)   X-Ref
Adds the $validationFailures attribute to store ValidationFailed objects.

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.

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: mixed <code>true</code> if all columns pass validation

addGetValidationFailures(&$script)   X-Ref
Adds the getValidationFailures() method.

param: string &$script The script will be modified in this method.

getValidationFailures()   X-Ref
Gets any ValidationFailed objects that resulted from last call to validate().

return: array ValidationFailed[]

addGetPrimaryKey(&$script)   X-Ref
Adds the correct getPrimaryKey() method for this object.

param: string &$script The script will be modified in this method.

addGetPrimaryKey_SinglePK(&$script)   X-Ref
Adds the getPrimaryKey() method for tables that contain a single-column primary key.

param: string &$script The script will be modified in this method.

getPrimaryKey()   X-Ref
Returns the primary key for this object (row).

return: $cptype

addGetPrimaryKey_MultiPK(&$script)   X-Ref
Adds the setPrimaryKey() method for tables that contain a multi-column primary key.

param: string &$script The script will be modified in this method.

getPrimaryKey()   X-Ref
Returns the composite primary key for this object.
The array elements will be in same order as specified in XML.

return: array

addGetPrimaryKey_NoPK(&$script)   X-Ref
Adds the getPrimaryKey() method for objects that have no primary key.
This "feature" is dreprecated, since the getPrimaryKey() method is not required
by the Persistent interface (or used by the templates).  Hence, this method is also
deprecated.

param: string &$script The script will be modified in this method.

getPrimaryKey()   X-Ref
Returns NULL since this table doesn't have a primary key.
This method exists only for BC and is deprecated!

return: null

addSetPrimaryKey(&$script)   X-Ref
Adds the correct setPrimaryKey() method for this object.

param: string &$script The script will be modified in this method.

addSetPrimaryKey_SinglePK(&$script)   X-Ref
Adds the setPrimaryKey() method for tables that contain a single-column primary key.

param: string &$script The script will be modified in this method.

setPrimaryKey(\$key)   X-Ref
Generic method to set the primary key ($clo column).

param: $ctype \$key Primary key.
return: void

addSetPrimaryKey_MultiPK(&$script)   X-Ref
Adds the setPrimaryKey() method for tables that contain a multi-columnprimary key.

param: string &$script The script will be modified in this method.

setPrimaryKey(\$keys)   X-Ref
Set the [composite] primary key.

param: array \$keys The elements of the composite key (order must match the order in XML file).
return: void

addSetPrimaryKey_NoPK(&$script)   X-Ref
Adds the setPrimaryKey() method for objects that have no primary key.
This "feature" is dreprecated, since the setPrimaryKey() method is not required
by the Persistent interface (or used by the templates).  Hence, this method is also
deprecated.

param: string &$script The script will be modified in this method.

setPrimaryKey(\$pk)   X-Ref
Dummy primary key setter.

This function only exists to preserve backwards compatibility.  It is no longer
needed or required by the Persistent interface.  It will be removed in next BC-breaking
release of Propel.


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()   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.

return: ".$table->getPhpName()." Clone of current object.

addCopyInto(&$script)   X-Ref
Adds the copy() method.


copyInto(\$copyObj)   X-Ref
Sets contents of passed object to values from current object.

param: object \$copyObj An object of ".$table->getPhpName()." (or compatible) type.
return: ".$table->getPhpName()." Clone of current object.



Généré le : Fri Mar 16 22:42:14 2007 par Balluche grâce à PHPXref 0.7