Doctrine_Record __construct(
[Doctrine_Table|null
$table = null], [boolean
$isNewEntry = false]
)
|
|
constructor
Parameters:
Doctrine_Table|null |
$table: |
a Doctrine_Table object or null, if null the table object is retrieved from current connection |
boolean |
$isNewEntry: |
whether or not this record is transient |
API Tags:
Information Tags:
Throws: | Doctrine_Record_Exception if the cleanData operation fails somehow |
Throws: | Doctrine_Connection_Exception if object is created using the new operator and there are no open connections |
boolean assignDefaultValues(
[boolean
$overwrite = false]
)
|
|
setDefaultValues sets the default values for records internal data
Parameters:
boolean |
$overwrite: |
whether or not to overwrite the already set values |
API Tags:
void assignIdentifier(
[integer
$id = false]
)
|
|
assignIdentifier
Parameters:
API Tags:
call
Parameters:
string|array |
$callback: |
valid callback |
string |
$column: |
column name |
mixed |
2: |
arg1 ... argN optional callback arguments |
API Tags:
integer cleanData(
&$data, array
$data
)
|
|
cleanData
Parameters:
array |
$data: |
data array to be cleaned |
|
&$data: |
|
API Tags:
alias for count()
API Tags:
Return: | the number of columns in this record |
Access: | public |
construct Empty tempalte method to provide concrete Record classes with the possibility to hook into the constructor procedure
API Tags:
boolean contains(
string
$name
)
|
|
contains
Parameters:
API Tags:
copy returns a copy of this object
API Tags:
copyDeep returns a copy of this object and all its related objects
API Tags:
void coreSetRelated(
$name,
$value
)
|
|
Parameters:
API Tags:
count this class implements countable interface
API Tags:
Return: | the number of columns in this record |
Access: | public |
Implementation of:
- Countable::count
deletes this data access object and all the related composites this operation is isolated by a transaction
this event can be listened by the onPreDelete and onDelete listeners
Parameters:
API Tags:
Return: | true on success, false on failure |
Access: | public |
used to delete node from tree - MUST BE USE TO DELETE RECORD IF TABLE ACTS AS TREE
API Tags:
errorStack assigns / returns record errorStack
Parameters:
API Tags:
Return: | returns the errorStack associated with this record |
Access: | public |
exists returns true if this record is persistent, otherwise false
API Tags:
mixed get(
mixed
$name, [boolean
$load = true]
)
|
|
get returns a value of a property or a related component
Parameters:
mixed |
$name: |
name of the property or related component |
boolean |
$load: |
whether or not to invoke the loading procedure |
API Tags:
Information Tags:
Throws: | Doctrine_Record_Exception if trying to get a value of unknown property / related component |
Redefined in descendants as:
getData return all the internal data
API Tags:
Return: | an array containing all the properties |
Access: | public |
getErrorStack
API Tags:
Return: | returns the errorStack associated with this record |
Access: | public |
integer getIncremented(
)
|
|
returns the value of autoincremented primary key of this object (if any)
API Tags:
getIterator
API Tags:
Return: | a Doctrine_Record_Iterator that iterates through the data |
Access: | public |
Implementation of:
- IteratorAggregate::getIterator
getLast
this method is used internally be Doctrine_Query it is needed to provide compatibility between records and collections
API Tags:
returns an array of modified fields and associated values
API Tags:
getter for node assciated with this record
API Tags:
Return: | if tree returns Doctrine_Node otherwise returns false |
Access: | public |
getOid returns the object identifier
API Tags:
array getPrepared(
[
$array = array()]
)
|
|
getPrepared
returns an array of modified fields and values with data preparation adds column aggregation inheritance and converts Records into primary key values
Parameters:
API Tags:
getReferences
API Tags:
Return: | all references |
Access: | public |
getTable returns the table object for this record
API Tags:
Return: | a Doctrine_Table object |
Access: | public |
boolean hasReference(
string
$name
)
|
|
hasRefence
Parameters:
API Tags:
boolean hasRelation(
mixed
$name
)
|
|
method for checking existence of properties and Doctrine_Record references
Parameters:
mixed |
$name: |
name of the property or reference |
API Tags:
hydrate hydrates this object from given array
Parameters:
API Tags:
returns the primary keys of this object
API Tags:
isModified returns true if this record was modified, otherwise false
API Tags:
isValid
API Tags:
Return: | whether or not this record passes all column validations |
Access: | public |
load loads all the unitialized properties from the database
API Tags:
void loadReference(
string
$name
)
|
|
loadReference loads a related component
Parameters:
API Tags:
Information Tags:
Throws: | Doctrine_Table_Exception if trying to load an unknown related component |
void mapValue(
string
$name, mixed
$value
)
|
|
mapValue This simple method is used for mapping values to $values property.
Usually this method is used internally by Doctrine for the mapping of aggregate values.
Parameters:
string |
$name: |
the name of the mapped value |
mixed |
$value: |
mixed value to be mapped |
API Tags:
merge merges this record with an array of values
Parameters:
API Tags:
void obtainReference(
string
$name
)
|
|
obtainReference
Parameters:
API Tags:
Information Tags:
Throws: | Doctrine_Record_Exception if trying to get an unknown related component |
void postDelete(
$event
)
|
|
Empty template method to provide concrete Record classes with the possibility to hook into the deletion procedure.
Parameters:
API Tags:
void postInsert(
$event
)
|
|
Empty template method to provide concrete Record classes with the possibility to hook into the saving procedure only when the record is going to be inserted into the data store the first time.
Parameters:
API Tags:
Empty template method to provide concrete Record classes with the possibility to hook into the saving procedure.
Parameters:
API Tags:
void postSerialize(
$event
)
|
|
Empty template method to provide concrete Record classes with the possibility to hook into the serializing procedure.
Parameters:
API Tags:
void postUnserialize(
$event
)
|
|
Empty template method to provide concrete Record classes with the possibility to hook into the serializing procedure.
Parameters:
API Tags:
void postUpdate(
$event
)
|
|
Empty template method to provide concrete Record classes with the possibility to hook into the saving procedure only when the record is going to be updated.
Parameters:
API Tags:
Empty template method to provide concrete Record classes with the possibility to hook into the deletion procedure.
Parameters:
API Tags:
Empty template method to provide concrete Record classes with the possibility to hook into the saving procedure only when the record is going to be inserted into the data store the first time.
Parameters:
API Tags:
void prepareIdentifiers(
[boolean
$exists = true]
)
|
|
prepareIdentifiers prepares identifiers for later use
Parameters:
boolean |
$exists: |
whether or not this record exists in persistent data store |
API Tags:
Empty template method to provide concrete Record classes with the possibility to hook into the saving procedure.
Parameters:
API Tags:
void preSerialize(
$event
)
|
|
Empty template method to provide concrete Record classes with the possibility to hook into the serializing procedure.
Parameters:
API Tags:
void preUnserialize(
$event
)
|
|
Empty template method to provide concrete Record classes with the possibility to hook into the serializing procedure.
Parameters:
API Tags:
Empty template method to provide concrete Record classes with the possibility to hook into the saving procedure only when the record is going to be updated.
Parameters:
API Tags:
mixed rawGet(
$name
$name
)
|
|
rawGet returns the value of a property, if the property is not yet loaded this method does NOT load it
Parameters:
$name |
$name: |
name of the property |
API Tags:
Information Tags:
Throws: | Doctrine_Record_Exception if trying to get an unknown property |
refresh refresh internal data from the database
API Tags:
Information Tags:
Throws: | Doctrine_Record_Exception When the refresh operation fails (when the database row this record represents does not exist anymore) |
refresh refres data of related objects from the database
Parameters:
string |
$name: |
name of a related component. if set, this method only refreshes the specified related component |
API Tags:
Return: | this object |
Access: | public |
replace
Execute a SQL REPLACE query. A REPLACE query is identical to a INSERT query, except that if there is already a row in the table with the same key field values, the REPLACE query just updates its values instead of inserting a new row.
The REPLACE type of query does not make part of the SQL standards. Since practically only MySQL and SQLIte implement it natively, this type of query isemulated through this method for other DBMS using standard types of queries inside a transaction to assure the atomicity of the operation.
Parameters:
API Tags:
Return: | number of rows affected |
Access: | public |
Information Tags:
Throws: | Doctrine_Connection_Exception if some of the key values was null |
Throws: | Doctrine_Connection_Exception if there were no key fields |
Throws: | PDOException if something fails at PDO level |
revert reverts this record to given version, this method only works if versioning plugin is enabled
Parameters:
integer |
$version: |
an integer > 1 |
API Tags:
Return: | this object |
Access: | public |
Information Tags:
Throws: | Doctrine_Record_Exception if given version does not exist |
applies the changes made to this object into database this method is smart enough to know if any changes are made and whether to use INSERT or UPDATE statement
this method also saves the related components
Parameters:
API Tags:
serialize this method is automatically called when this Doctrine_Record is serialized
API Tags:
Implementation of:
- Serializable::serialize
set method for altering properties and Doctrine_Record references if the load parameter is set to false this method will not try to load uninitialized record data
Parameters:
mixed |
$name: |
name of the property or reference |
mixed |
$value: |
value of the property or reference |
boolean |
$load: |
whether or not to refresh / load the uninitialized record data |
API Tags:
Information Tags:
Throws: | Doctrine_Record_Exception if trying to set a value of wrong type for related component |
Throws: | Doctrine_Record_Exception if trying to set a value for unknown property / related component |
setRelated
Parameters:
API Tags:
setUp this method is used for setting up relations and attributes it should be implemented by child classes
API Tags:
Redefined in descendants as:
null|integer state(
[integer|string
$state = null]
)
|
|
state returns / assigns the state of this record
Parameters:
integer|string |
$state: |
if set, this method tries to set the record state to $state |
API Tags:
See: | Doctrine_Record::STATE_* constants |
Access: | public |
Information Tags:
Throws: | Doctrine_Record_State_Exception if trying to set an unknown state |
array toArray(
[boolean
$deep = false]
)
|
|
toArray returns the record as an array
Parameters:
boolean |
$deep: |
- Return also the relations |
API Tags:
Tries to save the object and all its related components.
In contrast to Doctrine_Record::save(), this method does not throw an exception when validation fails but returns TRUE on success or FALSE on failure.
Parameters:
API Tags:
Return: | if the record was saved sucessfully without errors, FALSE otherwise. |
Access: | public |
removeLinks removes links from this record to given records
Parameters:
string |
$alias: |
related component alias |
array |
$ids: |
the identifiers of the related records |
API Tags:
Return: | this object |
Access: | public |
void unserialize(
string
$serialized
)
|
|
unseralize this method is automatically called everytime a Doctrine_Record object is unserialized
Parameters:
string |
$serialized: |
Doctrine_Record as serialized string |
API Tags:
Information Tags:
Throws: | Doctrine_Record_Exception if the cleanData operation fails somehow |
Implementation of:
- Serializable::unserialize
Empty template method to provide concrete Record classes with the possibility to hook into the validation procedure, doing any custom / specialized validations that are neccessary.
API Tags:
Empty template method to provide concrete Record classes with the possibility to hook into the validation procedure only when the record is going to be inserted into the data store the first time.
API Tags:
Empty template method to provide concrete Record classes with the possibility to hook into the validation procedure only when the record is going to be updated.
API Tags:
mixed __call(
string
$method, array
$args
)
|
|
__call this method is a magic method that is being used for method overloading
the function of this method is to try to find given method from the templates this record is using and if it finds given method it will execute it
So, in sense, this method replicates the usage of mixins (as seen in some programming languages)
Parameters:
string |
$method: |
name of the method |
array |
$args: |
method arguments |
API Tags:
Return: | the return value of the given method |
Access: | public |
returns a string representation of this object
API Tags: