Class:Doctrine_Record - Superclass: Doctrine_Record_Abstract Class:Doctrine_Record_Abstract - Superclass: Doctrine_Access Class:Doctrine_Access - Superclass: Doctrine_Locator_Injectable Doctrine_Locator_Injectable
⌊ Doctrine_Access
⌊ Doctrine_Record_Abstract
⌊ Doctrine_Record
public abstract class Doctrine_Record
extends Doctrine_Record_Abstract
www.doctrine-project.org| Field Summary | |
|---|---|
| final int | CLEAN STATE a Doctrine_Record is in clean state when all of its properties are loaded from the database and none of its properties are changed. |
| final int | DIRTY STATE a Doctrine_Record is in dirty state when its properties are changed. |
| final int | LOCKED STATE a Doctrine_Record is temporarily locked during deletes and saves. |
| final int | PROXY STATE a Doctrine_Record is in proxy state when its properties are not fully loaded. |
| final int | NEW TCLEAN a Doctrine_Record is in transient clean state when it is created and none of its fields are modified. |
| final int | TDIRTY STATE a Doctrine_Record is in transient dirty state when it is created and some of its fields are modified but it is NOT yet persisted into database. |
| final int | TLOCKED STATE a Doctrine_Record is temporarily locked (and transient) during deletes and saves. |
| protected static array | Array of custom accessors for cache. |
| protected static array | Array of custom mutators for cache. |
| protected array $_data the record data | each element is one of 3 following types: - simple type (int, string) - field has a scalar value - null - field has NULL value in DB - Doctrine_Null - field value is unknown, it wasn't loaded yet. |
| protected Doctrine_Validator_ErrorStack error stack object | . |
| protected integer $_id the primary keys of this object | . |
| protected array | Array containing the save hooks and events that have been invoked. |
| protected array $_lastModified an array containing field names that were modified in the previous transaction | . |
| protected array $_modified an array containing field names that have been modified | . |
| protected Doctrine_Node_ |
. |
| protected array $_oldValues an array of the old values from set properties | . |
| protected string | Doctrine_Collection of objects needing to be deleted on save. |
| protected array $_pendingUnlinks | Array of pending un links in format alias => keys to be executed after save. |
| protected array $_references an array containing all the references | . |
| protected boolean | Whether or not to serialize references when a Doctrine_Record is serialized. |
| protected integer $_state the state of this record | . |
| protected array $_values the values array, aggregate values and such are mapped into this array | . |
| Fields inherited from Doctrine\Doctrine_Record_Abstract | |
|---|---|
| _table | |
| Constructor Summary | |
|---|---|
Doctrine_Record(Doctrine_Table|null table, boolean isNewEntry) constructor. |
|
| Method Summary | |
|---|---|
| boolean | assignDefaultValues(boolean overwrite) setDefaultValues sets the default values for records internal data. |
| void | assignIdentifier(mixed id) assigns an identifier to the instance, for database storage. |
| void | Assign the inheritance column values. |
| Doctrine_Record | call(string|array callback, string column, mixed arg1) call. |
| array | cleanData(array data) cleanData leaves the $data array only with values whose key is a field inside this record and returns the values that were removed from $data. |
| void | clearAccessor(string fieldName) clears the accessor for a field name. |
| void | makes all the already used save hooks available again. |
| void | clearMutator(string fieldName) clears the custom mutator for a field name. |
| void | clearRelated(string name) Clear a related reference or all references. |
| integer | alias for @see count(). |
| void | construct Empty template method to provide concrete Record classes with the possibility to hook into the constructor procedure. |
| boolean | contains(string fieldName, mixed offset) test whether a field (column, mapped value, related component, accessor) is accessible by @see get(). |
| Doctrine_Record | copy(boolean deep) generates a copy of this object. |
| void | coreSetRelated(string name, Doctrine_Record|Doctrine_Collection value) Places a related component in the object graph. |
| integer | count() implements Countable interface. |
| boolean | delete(mixed conn) deletes this data access object and all the related composites this operation is isolated by a transaction. |
| void | used to delete node from tree - MUST BE USE TO DELETE RECORD IF TABLE ACTS AS TREE. |
| void|Doctrine_Validator_ErrorStack | errorStack(mixed stack, Doctrine_Validator_ErrorStack errorStack) assigns the ErrorStack or returns it if called without parameters. |
| boolean | exists() returns true if this record is saved in the database, otherwise false (it is transient). |
| string | exportTo(string type, string deep) exports instance to a chosen format. |
| void | free(boolean deep) Helps freeing the memory occupied by the entity. |
| void | fromArray(string array, bool deep) imports data from a php array. |
| mixed | get(mixed fieldName, boolean load, mixed offset) returns a value of a property or a related component. |
| string | getAccessor(string fieldName) gets the custom accessor for a field name. |
| array | gets all accessors for this component instance. |
| array | getData() return all the internal data (columns). |
| Doctrine_Validator_ErrorStack | retrieves the ErrorStack. |
| string | Get the record error stack as a human readable string. |
| final integer | returns the value of autoincremented primary key of this object (if any). |
| Doctrine_Record_Iterator | implements IteratorAggregate interface. |
| Doctrine_Record | getLast() getLast this method is used internally by Doctrine_Query it is needed to provide compatibility between records and collections. |
| array | getLastModified(boolean old) returns an array of the modified fields from the last transaction.. |
| array | getModified(boolean old, boolean last) retrieves an array of modified fields and associated new values.. |
| string | getMutator(mixed fieldName, string fieldname) gets the custom mutator for a field name. |
| array | gets all custom mutators for this component instance. |
| Doctrine_Node | getNode() getter for node associated with this record. |
| integer | getOid() . |
| array | returns Doctrine_Record instances which need to be deleted on save. |
| array | returns Doctrine_Record instances which need to be unlinked (deleting the relation) on save. |
| array | getPrepared(array array) Retrieves data prepared for a sql transaction. |
| array | get all related components. |
| Doctrine_Table | getTable() returns the table object for this record.. |
| boolean | hasAccessor(string fieldName, string accessor) sets a fieldname to have a custom accessor or check if a field has a custom accessor defined (when called without $accessor parameter).. |
| void | hasAccessorMutator(mixed fieldName, string accessor, string mutator, string fieldname) Set a fieldname to have a custom accessor and mutator. |
| boolean | hasMappedValue(string name) Tests whether a mapped value exists. |
| boolean | hasMutator(string fieldName, string mutator) sets a fieldname to have a custom mutator or check if a field has a custom mutator defined (when called without the $mutator parameter). |
| boolean | hasReference(string name) tests whether a relation is set. |
| boolean | hasRelation(mixed fieldName) checks existence of properties and related components. |
| void | hydrate(array data, boolean overwriteLocalChanges) hydrate hydrates this object from given array. |
| array | returns the primary keys of this object. |
| void | importFrom(string type, string data, mixed deep) imports data from a chosen format in the current instance. |
| Doctrine_Event | invokeSaveHooks(string when, string type, Doctrine_Event event) calls a subclass hook. |
| boolean | indicates whether record has any not loaded fields. |
| boolean | isModified(boolean deep) returns true if this record was modified, otherwise false. |
| boolean | isValid(boolean deep, boolean hooks) tests validity of the record using the current data.. |
| Doctrine_Record | link(string alias, array ids, boolean now) creates links from this record to given records. |
| Doctrine_Record | linkInDb(string alias, array ids) creates links from this record to given records now, querying the db. |
| boolean | load(array data) loads all the uninitialized properties from the database. |
| void | loadReference(string name) loadReference loads a related component. |
| void | mapValue(string name, mixed value) sets a value that will be managed as if it were a field by magic accessor and mutators, @see get() and @see set(). |
| void | merge(mixed data, bool deep, string array) merges this record with an array of values or with another existing instance of this object. |
| void | obtainReference(string name) gets a related component and fails if it does not exist. |
| void | oid() |
| void | postDelete(mixed event) Empty template method to provide concrete Record classes with the possibility to hook into the deletion procedure.. |
| void | postHydrate(mixed event) Empty template method to provide Record classes with the ability to alter hydration after it runs. |
| void | postInsert(mixed 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.. |
| void | postSave(mixed event) Empty template method to provide concrete Record classes with the possibility to hook into the saving procedure.. |
| void | postSerialize(mixed event) Empty template method to provide concrete Record classes with the possibility to hook into the serializing procedure.. |
| void | postUnserialize(mixed event) Empty template method to provide concrete Record classes with the possibility to hook into the serializing procedure.. |
| void | postUpdate(mixed 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.. |
| void | postValidate(mixed event) Empty template method to provide concrete Record classes with the possibility to hook into the validation procedure.. |
| void | preDelete(mixed event) Empty template method to provide concrete Record classes with the possibility to hook into the deletion procedure.. |
| void | preDqlDelete(mixed event) Empty template method to provide Record classes with the ability to alter DQL delete queries at runtime. |
| void | preDqlSelect(mixed event) Empty template method to provide Record classes with the ability to alter DQL select queries at runtime. |
| void | preDqlUpdate(mixed event) Empty template method to provide Record classes with the ability to alter DQL update queries at runtime. |
| void | preHydrate(mixed event) Empty template method to provide Record classes with the ability to alter hydration before it runs. |
| void | preInsert(mixed 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.. |
| void | preSave(mixed event) Empty template method to provide concrete Record classes with the possibility to hook into the saving procedure.. |
| void | preSerialize(mixed event) Empty template method to provide concrete Record classes with the possibility to hook into the serializing procedure.. |
| void | preUnserialize(mixed event) Empty template method to provide concrete Record classes with the possibility to hook into the serializing procedure.. |
| void | preUpdate(mixed 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.. |
| void | preValidate(mixed event) Empty template method to provide concrete Record classes with the possibility to hook into the validation procedure. |
| mixed | rawGet(mixed fieldName, $name name) returns the value of a property (column). |
| Doctrine_Record|Doctrine_Collection | reference(string name) gets a related component. |
| boolean | refresh(bool deep) refresh refresh internal data from the database. |
| Doctrine_Record | refreshRelated(string name) refresh refresh data of related objects from the database. |
| boolean | relatedExists(string name) Check if a related relationship exists. |
| integer | replace(Doctrine_Connection conn) executes a SQL REPLACE query. |
| void | resets pending record unlinks. |
| void | save(Doctrine_Connection conn) 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. |
| string | serialize this method is automatically called when an instance of Doctrine_Record is serialized. |
| boolean | serializeReferences(boolean bool) Set whether or not to serialize references. |
| Doctrine_Record | set(mixed fieldName, mixed value, boolean load, mixed name, mixed offset) alters mapped values, properties and related components.. |
| final void | setRelated(string alias, Doctrine_Access coll) set a related component. |
| void | setUp() setUp this method is used for setting up relations and attributes it should be implemented by child classes. |
| null|integer | state(integer|string state) assigns the state of this record or returns it if called without parameters. |
| void | synchronizeWithArray(array array, bool deep) synchronizes a Doctrine_Record instance and its relations with data from an array. |
| array | toArray(boolean deep, boolean prefixKey) returns the record representation as an array. |
| string | toString() __toString alias. |
| TRUE | trySave(Doctrine_Connection conn) tries to save the object and all its related components. |
| Doctrine_Record | unlink(string alias, array ids, boolean now) unlink removes links from this record to given records if no ids are given, it removes all links. |
| Doctrine_Record | unlinkInDb(string alias, array ids) unlink now the related components, querying the db. |
| void | unserialize(string serialized) this method is automatically called everytime an instance is unserialized. |
| void | unshiftFilter(mixed filter) |
| protected void | validate() 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.. |
| protected void | 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.. |
| protected void | 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.. |
| Methods inherited from Doctrine\Doctrine_Record_Abstract | |
|---|---|
| actAs, addListener, attribute, bindQueryParts, check, getListener, getTable, hasColumn, hasColumns, hasMany, hasOne, index, loadGenerator, option, setAttribute, setColumnOption, setColumnOptions, setInheritanceMap, setListener, setSubclasses, setTableDefinition, setTableName, setUp, unique | |
| Methods inherited from Doctrine\Doctrine_Access | |
|---|---|
| add, contains, get, offsetExists, offsetGet, offsetSet, offsetUnset, remove, set, setArray | |
| Methods inherited from Doctrine\Doctrine_Locator_Injectable | |
|---|---|
| bind, getLocator, getNullObject, initNullObject, locate, setLocator | |
public final int STATE_CLEAN = 3
CLEAN STATE a Doctrine_Record is in clean state when all of its properties are loaded from the database and none of its properties are changed
public final int STATE_DIRTY = 1
DIRTY STATE a Doctrine_Record is in dirty state when its properties are changed
public final int STATE_LOCKED = 6
LOCKED STATE a Doctrine_Record is temporarily locked during deletes and saves
This state is used internally to ensure that circular deletes and saves will not cause infinite loops
public final int STATE_PROXY = 4
PROXY STATE a Doctrine_Record is in proxy state when its properties are not fully loaded
public final int STATE_TCLEAN = 5
NEW TCLEAN a Doctrine_Record is in transient clean state when it is created and none of its fields are modified
public final int STATE_TDIRTY = 2
TDIRTY STATE a Doctrine_Record is in transient dirty state when it is created and some of its fields are modified but it is NOT yet persisted into database
public final int STATE_TLOCKED = 7
TLOCKED STATE a Doctrine_Record is temporarily locked (and transient) during deletes and saves
This state is used internally to ensure that circular deletes and saves will not cause infinite loops
protected static array $_customAccessors = array()
Array of custom accessors for cache
protected static array $_customMutators = array()
Array of custom mutators for cache
protected array $_data the record data $_data = array()
each element is one of 3 following types: - simple type (int, string) - field has a scalar value - null - field has NULL value in DB - Doctrine_Null - field value is unknown, it wasn't loaded yet
protected Doctrine_Validator_ErrorStack error stack object $_errorStack
protected integer $_id the primary keys of this object $_id = array()
protected array $_invokedSaveHooks = false
Array containing the save hooks and events that have been invoked
protected array $_lastModified an array containing field names that were modified in the previous transaction $_lastModified = array()
protected array $_modified an array containing field names that have been modified $_modified = array()
protected Doctrine_Node_ node object $_node
protected array $_oldValues an array of the old values from set properties $_oldValues = array()
protected string $_pendingDeletes = array()
Doctrine_Collection of objects needing to be deleted on save
protected array $_pendingUnlinks $_pendingUnlinks = array()
Array of pending un links in format alias => keys to be executed after save
protected array $_references an array containing all the references $_references = array()
protected boolean $_serializeReferences = false
Whether or not to serialize references when a Doctrine_Record is serialized
protected integer $_state the state of this record $_state
protected array $_values the values array, aggregate values and such are mapped into this array $_values = array()
public Doctrine_Record(Doctrine_Table|null table, boolean isNewEntry)
constructor
public boolean assignDefaultValues(boolean overwrite)
setDefaultValues sets the default values for records internal data
public void assignIdentifier(mixed id)
assigns an identifier to the instance, for database storage
public void assignInheritanceValues()
Assign the inheritance column values
public Doctrine_Record call(string|array callback, string column, mixed arg1)
call
public array cleanData(array data)
cleanData leaves the $data array only with values whose key is a field inside this record and returns the values that were removed from $data. Also converts any values of 'null' to objects of type Doctrine_Null.
public void clearAccessor(string fieldName)
clears the accessor for a field name
public void clearInvokedSaveHooks()
makes all the already used save hooks available again
public void clearMutator(string fieldName)
clears the custom mutator for a field name
public void clearRelated(string name)
Clear a related reference or all references
public integer columnCount()
alias for @see count()
public void construct()
construct Empty template method to provide concrete Record classes with the possibility to hook into the constructor procedure
public boolean contains(string fieldName, mixed offset)
test whether a field (column, mapped value, related component, accessor) is accessible by @see get()
public Doctrine_Record copy(boolean deep)
generates a copy of this object. Returns an instance of the same class of $this.
public void coreSetRelated(string name, Doctrine_Record|Doctrine_Collection value)
Places a related component in the object graph.
This method inserts a related component instance in this record relations, populating the foreign keys accordingly.
public integer count()
implements Countable interface
public boolean delete(mixed conn)
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
public void deleteNode()
used to delete node from tree - MUST BE USE TO DELETE RECORD IF TABLE ACTS AS TREE
public void|Doctrine_Validator_ErrorStack errorStack(mixed stack, Doctrine_Validator_ErrorStack errorStack)
assigns the ErrorStack or returns it if called without parameters
public boolean exists()
returns true if this record is saved in the database, otherwise false (it is transient)
public string exportTo(string type, string deep)
exports instance to a chosen format
public void free(boolean deep)
Helps freeing the memory occupied by the entity. Cuts all references the entity has to other entities and removes the entity from the instance pool. Note: The entity is no longer useable after free() has been called. Any operations done with the entity afterwards can lead to unpredictable results.
public void fromArray(string array, bool deep)
imports data from a php array
http://www.doctrine-project.org/documentation/manual/1_1/en/working-with-modelspublic mixed get(mixed fieldName, boolean load, mixed offset)
returns a value of a property or a related component
public string getAccessor(string fieldName)
gets the custom accessor for a field name
public array getAccessors()
gets all accessors for this component instance
public array getData()
return all the internal data (columns)
public Doctrine_Validator_ErrorStack getErrorStack()
retrieves the ErrorStack. To be called after a failed validation attempt (@see isValid()).
public string getErrorStackAsString()
Get the record error stack as a human readable string. Useful for outputting errors to user via web browser
public final integer getIncremented()
returns the value of autoincremented primary key of this object (if any)
public Doctrine_Record_Iterator getIterator()
implements IteratorAggregate interface
public Doctrine_Record getLast()
getLast this method is used internally by Doctrine_Query it is needed to provide compatibility between records and collections
public array getLastModified(boolean old)
returns an array of the modified fields from the last transaction.
public array getModified(boolean old, boolean last)
retrieves an array of modified fields and associated new values.
public string getMutator(mixed fieldName, string fieldname)
gets the custom mutator for a field name
public array getMutators()
gets all custom mutators for this component instance
public Doctrine_Node getNode()
getter for node associated with this record
public integer getOid()
public array getPendingDeletes()
returns Doctrine_Record instances which need to be deleted on save
public array getPendingUnlinks()
returns Doctrine_Record instances which need to be unlinked (deleting the relation) on save
public array getPrepared(array array)
Retrieves data prepared for a sql transaction.
Returns an array of modified fields and values with data preparation; adds column aggregation inheritance and converts Records into primary key values.
public array getReferences()
get all related components
public Doctrine_Table getTable()
returns the table object for this record.
public boolean hasAccessor(string fieldName, string accessor)
sets a fieldname to have a custom accessor or check if a field has a custom accessor defined (when called without $accessor parameter).
public void hasAccessorMutator(mixed fieldName, string accessor, string mutator, string fieldname)
Set a fieldname to have a custom accessor and mutator
public boolean hasMappedValue(string name)
Tests whether a mapped value exists
public boolean hasMutator(string fieldName, string mutator)
sets a fieldname to have a custom mutator or check if a field has a custom mutator defined (when called without the $mutator parameter)
public boolean hasReference(string name)
tests whether a relation is set
public boolean hasRelation(mixed fieldName)
checks existence of properties and related components
public void hydrate(array data, boolean overwriteLocalChanges)
hydrate hydrates this object from given array
public array identifier()
returns the primary keys of this object
public void importFrom(string type, string data, mixed deep)
imports data from a chosen format in the current instance
public Doctrine_Event invokeSaveHooks(string when, string type, Doctrine_Event event)
calls a subclass hook. Idempotent until @see clearInvokedSaveHooks() is called.
$this->invokeSaveHooks('pre', 'save');
public boolean isInProxyState()
indicates whether record has any not loaded fields
public boolean isModified(boolean deep)
returns true if this record was modified, otherwise false
public boolean isValid(boolean deep, boolean hooks)
tests validity of the record using the current data.
public Doctrine_Record link(string alias, array ids, boolean now)
creates links from this record to given records
public Doctrine_Record linkInDb(string alias, array ids)
creates links from this record to given records now, querying the db
public boolean load(array data)
loads all the uninitialized properties from the database. Used to move a record from PROXY to CLEAN/DIRTY state.
public void loadReference(string name)
loadReference loads a related component
public void mapValue(string name, mixed value)
sets a value that will be managed as if it were a field by magic accessor and mutators, @see get() and @see set(). Normally used by Doctrine for the mapping of aggregate values.
public void merge(mixed data, bool deep, string array)
merges this record with an array of values or with another existing instance of this object
http://www.doctrine-project.org/documentation/manual/1_1/en/working-with-modelspublic void obtainReference(string name)
gets a related component and fails if it does not exist
public void oid()
public void postDelete(mixed event)
Empty template method to provide concrete Record classes with the possibility to hook into the deletion procedure.
public void postHydrate(mixed event)
Empty template method to provide Record classes with the ability to alter hydration after it runs
public void postInsert(mixed 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.
public void postSave(mixed event)
Empty template method to provide concrete Record classes with the possibility to hook into the saving procedure.
public void postSerialize(mixed event)
Empty template method to provide concrete Record classes with the possibility to hook into the serializing procedure.
public void postUnserialize(mixed event)
Empty template method to provide concrete Record classes with the possibility to hook into the serializing procedure.
public void postUpdate(mixed 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.
public void postValidate(mixed event)
Empty template method to provide concrete Record classes with the possibility to hook into the validation procedure.
public void preDelete(mixed event)
Empty template method to provide concrete Record classes with the possibility to hook into the deletion procedure.
public void preDqlDelete(mixed event)
Empty template method to provide Record classes with the ability to alter DQL delete queries at runtime
public void preDqlSelect(mixed event)
Empty template method to provide Record classes with the ability to alter DQL select queries at runtime
public void preDqlUpdate(mixed event)
Empty template method to provide Record classes with the ability to alter DQL update queries at runtime
public void preHydrate(mixed event)
Empty template method to provide Record classes with the ability to alter hydration before it runs
public void preInsert(mixed 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.
public void preSave(mixed event)
Empty template method to provide concrete Record classes with the possibility to hook into the saving procedure.
public void preSerialize(mixed event)
Empty template method to provide concrete Record classes with the possibility to hook into the serializing procedure.
public void preUnserialize(mixed event)
Empty template method to provide concrete Record classes with the possibility to hook into the serializing procedure.
public void preUpdate(mixed 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.
public void preValidate(mixed event)
Empty template method to provide concrete Record classes with the possibility to hook into the validation procedure. Useful for cleaning up data before validating it.
public mixed rawGet(mixed fieldName, $name name)
returns the value of a property (column). If the property is not yet loaded this method does NOT load it.
public Doctrine_Record|Doctrine_Collection reference(string name)
gets a related component
public boolean refresh(bool deep)
refresh refresh internal data from the database
public Doctrine_Record refreshRelated(string name)
refresh refresh data of related objects from the database
public boolean relatedExists(string name)
Check if a related relationship exists. Will lazily load the relationship in order to check. If the reference didn't already exist and it doesn't exist in the database, the related reference will be cleared immediately.
public integer replace(Doctrine_Connection conn)
executes 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.
public void resetPendingUnlinks()
resets pending record unlinks
public void save(Doctrine_Connection conn)
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
public string serialize()
serialize this method is automatically called when an instance of Doctrine_Record is serialized
public boolean serializeReferences(boolean bool)
Set whether or not to serialize references. This is used by caching since we want to serialize references when caching but not when just normally serializing a instance
public Doctrine_Record set(mixed fieldName, mixed value, boolean load, mixed name, mixed offset)
alters mapped values, properties and related components.
public final void setRelated(string alias, Doctrine_Access coll)
set a related component
public void setUp()
setUp this method is used for setting up relations and attributes it should be implemented by child classes
public null|integer state(integer|string state)
assigns the state of this record or returns it if called without parameters
public void synchronizeWithArray(array array, bool deep)
synchronizes a Doctrine_Record instance and its relations with data from an array
it expects an array representation of a Doctrine_Record similar to the return value of the toArray() method. If the array contains relations it will create those that don't exist, update the ones that do, and delete the ones missing on the array but available on the Doctrine_Record (unlike @see fromArray() that does not touch what it is not in $array)
public array toArray(boolean deep, boolean prefixKey)
returns the record representation as an array
http://www.doctrine-project.org/documentation/manual/1_1/en/working-with-modelspublic string toString()
__toString alias
public TRUE trySave(Doctrine_Connection conn)
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.
public Doctrine_Record unlink(string alias, array ids, boolean now)
unlink removes links from this record to given records if no ids are given, it removes all links
public Doctrine_Record unlinkInDb(string alias, array ids)
unlink now the related components, querying the db
public void unserialize(string serialized)
this method is automatically called everytime an instance is unserialized
public void unshiftFilter(mixed filter)
protected void validate()
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.
protected void validateOnInsert()
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.
protected void validateOnUpdate()
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.
Doctrine_Record All record classes should inherit this super class