Classes:
Doctrine
Doctrine_Access
Doctrine_Adapter
Doctrine_Adapter_Db2_Exception
Doctrine_Adapter_Exception
Doctrine_Adapter_Statement
Doctrine_AuditLog
Doctrine_AuditLog_Listener
Doctrine_Collection
Doctrine_Collection_Exception
Doctrine_Collection_Iterator
Doctrine_Collection_Iterator_Expandable
Doctrine_Collection_Iterator_Normal
Doctrine_Collection_Iterator_Offset
Doctrine_Collection_Offset
Doctrine_Column
Doctrine_Compiler
Doctrine_Compiler_Exception
Doctrine_Configurable
Doctrine_Connection
Doctrine_Connection_Common
Doctrine_Connection_Db2
Doctrine_Connection_Exception
Doctrine_Connection_Firebird
Doctrine_Connection_Firebird_Exception
Doctrine_Connection_Informix
Doctrine_Connection_Informix_Exception
Doctrine_Connection_Mock
Doctrine_Connection_Module
Doctrine_Connection_Mssql
Doctrine_Connection_Mssql_Exception
Doctrine_Connection_Mysql
Doctrine_Connection_Mysql_Exception
Doctrine_Connection_Oracle
Doctrine_Connection_Oracle_Exception
Doctrine_Connection_Pgsql
Doctrine_Connection_Pgsql_Exception
Doctrine_Connection_Profiler
Doctrine_Connection_Profiler_Exception
Doctrine_Connection_Sqlite
Doctrine_Connection_Sqlite_Exception
Doctrine_Connection_Statement
Doctrine_Connection_UnitOfWork
Doctrine_DataDict
Doctrine_DataDict_Exception
Doctrine_DataDict_Informix
Doctrine_DataType
Doctrine_Db
Doctrine_Event
Doctrine_EventListener
Doctrine_EventListener_Chain
Doctrine_EventListener_Exception
Doctrine_Exception
Doctrine_Export
Doctrine_Export_Exception
Doctrine_Export_Firebird
Doctrine_Export_Frontbase
Doctrine_Export_Mssql
Doctrine_Export_Mysql
Doctrine_Export_Oracle
Doctrine_Export_Pgsql
Doctrine_Export_Reporter
Doctrine_Export_Schema
Doctrine_Export_Schema_Xml
Doctrine_Export_Schema_Yml
Doctrine_Export_Sqlite
Doctrine_Expression
Doctrine_Expression_Driver
Doctrine_Expression_Exception
Doctrine_Expression_Firebird
Doctrine_Expression_Informix
Doctrine_Expression_Mock
Doctrine_Expression_Mssql
Doctrine_Expression_Mysql
Doctrine_Expression_Oracle
Doctrine_Expression_Pgsql
Doctrine_Expression_Sqlite
Doctrine_File
Doctrine_File_Index
Doctrine_Formatter
Doctrine_Hook
Doctrine_Hook_Equal
Doctrine_Hook_Integer
Doctrine_Hook_Parser
Doctrine_Hook_Parser_Complex
Doctrine_Hook_WordLike
Doctrine_Hydrate
Doctrine_Hydrate_Array
Doctrine_Hydrate_Exception
Doctrine_Hydrate_Record
Doctrine_Import
Doctrine_Import_Builder
Doctrine_Import_Builder_BaseClass
Doctrine_Import_Builder_Exception
Doctrine_Import_Exception
Doctrine_Import_Firebird
Doctrine_Import_Informix
Doctrine_Import_Mssql
Doctrine_Import_Mysql
Doctrine_Import_Oracle
Doctrine_Import_Pgsql
Doctrine_Import_Reader
Doctrine_Import_Reader_Db
Doctrine_Import_Reader_Exception
Doctrine_Import_Reader_Xml_Propel
Doctrine_Import_Schema
Doctrine_Import_Schema_Xml
Doctrine_Import_Schema_Yml
Doctrine_Import_Sqlite
Doctrine_IntegrityMapper
Doctrine_Lib
Doctrine_Locking_Exception
Doctrine_Locking_Manager_Pessimistic
Doctrine_Manager
Doctrine_Manager_Exception
Doctrine_Node
Doctrine_Node_AdjacencyList
Doctrine_Node_AdjacencyList_LevelOrderIterator
Doctrine_Node_AdjacencyList_PostOrderIterator
Doctrine_Node_AdjacencyList_PreOrderIterator
Doctrine_Node_Exception
Doctrine_Node_MaterializedPath
Doctrine_Node_MaterializedPath_LevelOrderIterator
Doctrine_Node_MaterializedPath_PostOrderIterator
Doctrine_Node_MaterializedPath_PreOrderIterator
Doctrine_Node_NestedSet
Doctrine_Node_NestedSet_LevelOrderIterator
Doctrine_Node_NestedSet_PostOrderIterator
Doctrine_Node_NestedSet_PreOrderIterator
Doctrine_Null
Doctrine_Object
Doctrine_Plugin
Doctrine_Query
Doctrine_Query_Abstract
Doctrine_Query_Check
Doctrine_Query_Condition
Doctrine_Query_Exception
Doctrine_Query_Filter
Doctrine_Query_Filter_Chain
Doctrine_Query_From
Doctrine_Query_Groupby
Doctrine_Query_Having
Doctrine_Query_JoinCondition
Doctrine_Query_Limit
Doctrine_Query_Offset
Doctrine_Query_Orderby
Doctrine_Query_Parser
Doctrine_Query_Part
Doctrine_Query_Select
Doctrine_Query_Set
Doctrine_Query_Where
Doctrine_RawSql
Doctrine_RawSql_Exception
Doctrine_Record
Doctrine_Record_Abstract
Doctrine_Record_Exception
Doctrine_Record_Filter
Doctrine_Record_Iterator
Doctrine_Record_Listener
Doctrine_Record_Listener_Chain
Doctrine_Record_State_Exception
Doctrine_Relation
Doctrine_Relation_Association
Doctrine_Relation_Association_Self
Doctrine_Relation_Exception
Doctrine_Relation_ForeignKey
Doctrine_Relation_LocalKey
Doctrine_Relation_Nest
Doctrine_Relation_Parser
Doctrine_Relation_Parser_Exception
Doctrine_Schema
Doctrine_Schema_Column
Doctrine_Schema_Database
Doctrine_Schema_Exception
Doctrine_Schema_Object
Doctrine_Schema_Relation
Doctrine_Schema_Table
Doctrine_Search
Doctrine_Search_Analyzer
Doctrine_Search_Analyzer_Exception
Doctrine_Search_Analyzer_Standard
Doctrine_Search_Exception
Doctrine_Search_Indexer
Doctrine_Search_Indexer_Dir
Doctrine_Search_Indexer_Exception
Doctrine_Search_Listener
Doctrine_Search_Parser
Doctrine_Search_Query
Doctrine_Search_Record
Doctrine_Search_Scorer
Doctrine_Search_Template
Doctrine_Sequence
Doctrine_Sequence_Db2
Doctrine_Sequence_Exception
Doctrine_Sequence_Firebird
Doctrine_Sequence_Informix
Doctrine_Sequence_Mssql
Doctrine_Sequence_Mysql
Doctrine_Sequence_Oracle
Doctrine_Sequence_Pgsql
Doctrine_Sequence_Sqlite
Doctrine_Table
Doctrine_Table_Exception
Doctrine_Table_Repository
Doctrine_Table_Repository_Exception
Doctrine_Template
Doctrine_Template_NestedSet
Doctrine_Template_Searchable
Doctrine_Template_Taggable
Doctrine_Template_Versionable
Doctrine_Tokenizer
Doctrine_Transaction
Doctrine_Transaction_Exception
Doctrine_Transaction_Firebird
Doctrine_Transaction_Informix
Doctrine_Transaction_Mock
Doctrine_Transaction_Mssql
Doctrine_Transaction_Mysql
Doctrine_Transaction_Oracle
Doctrine_Transaction_Pgsql
Doctrine_Transaction_Sqlite
Doctrine_Tree
Doctrine_Tree_AdjacencyList
Doctrine_Tree_Exception
Doctrine_Tree_MaterializedPath
Doctrine_Tree_NestedSet
Doctrine_Util
Doctrine_Validator
Doctrine_Validator_Country
Doctrine_Validator_Creditcard
Doctrine_Validator_Date
Doctrine_Validator_Email
Doctrine_Validator_Enum
Doctrine_Validator_ErrorStack
Doctrine_Validator_Exception
Doctrine_Validator_HtmlColor
Doctrine_Validator_Ip
Doctrine_Validator_Minlength
Doctrine_Validator_Nospace
Doctrine_Validator_Notblank
Doctrine_Validator_Notnull
Doctrine_Validator_Range
Doctrine_Validator_Regexp
Doctrine_Validator_Unique
Doctrine_Validator_Unsigned
Doctrine_Validator_Usstate
Doctrine_View
Doctrine_View_Exception
Doctrine_Cache
Doctrine_Cache
Doctrine_Cache_Apc
Doctrine_Cache_Array
Doctrine_Cache_Db
Doctrine_Cache_Driver
Doctrine_Cache_Exception
Doctrine_Cache_Memcache
Doctrine_Adapter
Doctrine_Adapter_Db2
Doctrine_Adapter_Mock
Doctrine_Adapter_Mysqli
Doctrine_Adapter_Oracle
Doctrine_Adapter_Statement_Mock
Doctrine_DataDict
Doctrine_DataDict_Firebird
Doctrine_DataDict_Mssql
Doctrine_DataDict_Mysql
Doctrine_DataDict_Oracle
Doctrine_DataDict_Pgsql
Doctrine_DataDict_Sqlite

# Class: Doctrine_Record

Source Location: /Doctrine/Record.php

## Class Doctrine_Record

Class Overview

Implements interfaces: Countable (internal interface) IteratorAggregate (internal interface) Serializable (internal interface) Doctrine_Record All record classes should inherit this super class Located in /Doctrine/Record.php [line 34]
    Doctrine_Object
       |
       --Doctrine_Access
          |
          --Doctrine_Record_Abstract
             |
             --Doctrine_Record
Author(s): Konsta Vesterinen <kvesteri@cc.hut.fi> API Tags:
Abstract: |
Information Tags:
Version: | $Revision: 2294 $
Link: | www.phpdoctrine.com
Since: | 1.0
License: | LGPL
| Properties $_data $_errorStack $_filter $_id $_index $_modified $_node $_oid $_references $_state $_values | Methods __construct assignDefaultValues assignIdentifier call cleanData columnCount construct contains copy copyDeep coreSetRelated count delete deleteNode errorStack exists get getData getErrorStack getIncremented getIterator getLast getModified getNode getOid getPrepared getReferences getTable hasReference hasRelation hydrate identifier isModified isValid load loadReference mapValue merge obtainReference postDelete postInsert postSave postSerialize postUnserialize postUpdate preDelete preInsert prepareIdentifiers preSave preSerialize preUnserialize preUpdate rawGet refresh refreshRelated replace revert save serialize set setRelated setUp state toArray toString trySave unlink unserialize validate validateOnInsert validateOnUpdate _index __call __toString __unset

[ Top ]
Direct descendents

Child Class | Description
--- | ---
Doctrine_File_Index | Doctrine_File_Index
Doctrine_File | Doctrine_File

[ Top ]
Inherited Properties, Constants, and Methods

Inherited Properties | Inherited Methods | Inherited Constants
--- | --- | ---
Inherited From Doctrine_Record_Abstract Doctrine_Record_Abstract::$_table Inherited From Doctrine_Object Doctrine_Object::$_null | Inherited From Doctrine_Record_Abstract Doctrine_Record_Abstract::actAs() actAs loads a given plugin Doctrine_Record_Abstract::addListener() addListener Doctrine_Record_Abstract::attribute() attribute sets or retrieves an option Doctrine_Record_Abstract::check() check adds a check constraint Doctrine_Record_Abstract::getListener() getListener Doctrine_Record_Abstract::hasColumn() hasColumn sets a column definition Doctrine_Record_Abstract::hasColumns() Doctrine_Record_Abstract::hasMany() hasMany binds One-to-Many / Many-to-Many aggregate relation Doctrine_Record_Abstract::hasOne() hasOne binds One-to-One aggregate relation Doctrine_Record_Abstract::index() index Doctrine_Record_Abstract::loadTemplate() loadTemplate Doctrine_Record_Abstract::option() option sets or retrieves an option Doctrine_Record_Abstract::ownsMany() ownsMany binds One-to-Many / Many-to-Many composite relation Doctrine_Record_Abstract::ownsOne() ownsOne binds One-to-One composite relation Doctrine_Record_Abstract::setAttribute() Doctrine_Record_Abstract::setInheritanceMap() Doctrine_Record_Abstract::setListener() setListener Doctrine_Record_Abstract::setSubclasses() Doctrine_Record_Abstract::setTableName() Inherited From Doctrine_Access Doctrine_Access::offsetExists() Doctrine_Access::offsetGet() offsetGet an alias of get() Doctrine_Access::offsetSet() sets $offset to $value Doctrine_Access::offsetUnset() unset a given offset Doctrine_Access::setArray() setArray Doctrine_Access::__get() __get -- an alias of get() Doctrine_Access::__isset() __isset() Doctrine_Access::__set() __set an alias of set() Doctrine_Access::__unset() __unset() Inherited From Doctrine_Object Doctrine_Object::getNullObject() getNullObject returns the null object associated with this object Doctrine_Object::initNullObject() initNullObject initializes the null object |

[ Top ]
Constant Summary

STATE_CLEAN | CLEAN STATE
STATE_DIRTY | DIRTY STATE
STATE_LOCKED | LOCKED STATE a Doctrine_Record is temporarily locked during deletes and saves
STATE_PROXY | PROXY STATE
STATE_TCLEAN | NEW TCLEAN
STATE_TDIRTY | TDIRTY STATE

[ Top ]
Property Summary

static integer | $_index |
array | $_data |
Doctrine_Validator_ErrorStack | $_errorStack |
Doctrine_Record_Filter | $_filter |
integer | $_id |
array | $_modified |
Doctrine_Node_ | $_node |
integer | $_oid |
array | $_references |
integer | $_state |
array | $_values |

[ Top ]
Method Summary

static integer | _index() | _index
Doctrine_Record | __construct() | constructor
boolean | assignDefaultValues() | setDefaultValues sets the default values for records internal data
void | assignIdentifier() | assignIdentifier
Doctrine_Record | call() | call
integer | cleanData() | cleanData
integer | columnCount() | alias for count()
void | construct() | construct Empty tempalte method to provide concrete Record classes with the possibility to hook into the constructor procedure
boolean | contains() | contains
Doctrine_Record | copy() | copy returns a copy of this object
Doctrine_Record | copyDeep() | copyDeep returns a copy of this object and all its related objects
void | coreSetRelated() |
integer | count() | count this class implements countable interface
boolean | delete() | deletes this data access object and all the related composites this operation is isolated by a transaction
void | deleteNode() | used to delete node from tree - MUST BE USE TO DELETE RECORD IF TABLE ACTS AS TREE
void|Doctrine_Validator_ErrorStack | errorStack() | errorStack assigns / returns record errorStack
boolean | exists() | exists returns true if this record is persistent, otherwise false
mixed | get() | get returns a value of a property or a related component
array | getData() | getData return all the internal data
Doctrine_Validator_ErrorStack | getErrorStack() | getErrorStack
integer | getIncremented() | returns the value of autoincremented primary key of this object (if any)
Doctrine_Record_Iterator | getIterator() | getIterator
Doctrine_Record | getLast() | getLast
array | getModified() | returns an array of modified fields and associated values
mixed | getNode() | getter for node assciated with this record
integer | getOid() | getOid returns the object identifier
array | getPrepared() | getPrepared
array | getReferences() | getReferences
object Doctrine_Table | getTable() | getTable returns the table object for this record
boolean | hasReference() | hasRefence
boolean | hasRelation() | method for checking existence of properties and Doctrine_Record references
boolean | hydrate() | hydrate hydrates this object from given array
array | identifier() | returns the primary keys of this object
boolean | isModified() | isModified returns true if this record was modified, otherwise false
boolean | isValid() | isValid
boolean | load() | load loads all the unitialized properties from the database
void | loadReference() | loadReference loads a related component
void | mapValue() | mapValue This simple method is used for mapping values to $values property.
void | merge() | merge merges this record with an array of values
void | obtainReference() | obtainReference
void | postDelete() | Empty template method to provide concrete Record classes with the possibility to hook into the deletion procedure.
void | postInsert() | 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() | Empty template method to provide concrete Record classes with the possibility to hook into the saving procedure.
void | postSerialize() | Empty template method to provide concrete Record classes with the possibility to hook into the serializing procedure.
void | postUnserialize() | Empty template method to provide concrete Record classes with the possibility to hook into the serializing procedure.
void | postUpdate() | 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 | preDelete() | Empty template method to provide concrete Record classes with the possibility to hook into the deletion procedure.
void | preInsert() | 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 | prepareIdentifiers() | prepareIdentifiers prepares identifiers for later use
void | preSave() | Empty template method to provide concrete Record classes with the possibility to hook into the saving procedure.
void | preSerialize() | Empty template method to provide concrete Record classes with the possibility to hook into the serializing procedure.
void | preUnserialize() | Empty template method to provide concrete Record classes with the possibility to hook into the serializing procedure.
void | preUpdate() | 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.
mixed | rawGet() | rawGet returns the value of a property, if the property is not yet loaded this method does NOT load it
boolean | refresh() | refresh refresh internal data from the database
Doctrine_Record | refreshRelated() | refresh refres data of related objects from the database
integer | replace() | replace
Doctrine_Record | revert() | revert reverts this record to given version, this method only works if versioning plugin is enabled
void | save() | 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
array | serialize() | serialize this method is automatically called when this Doctrine_Record is serialized
Doctrine_Record | set() | 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
void | setRelated() | setRelated
void | setUp() | setUp this method is used for setting up relations and attributes it should be implemented by child classes
null|integer | state() | state returns / assigns the state of this record
array | toArray() | toArray returns the record as an array
void | toString() |
TRUE | trySave() | Tries to save the object and all its related components.
Doctrine_Record | unlink() | removeLinks removes links from this record to given records
void | unserialize() | unseralize this method is automatically called everytime a Doctrine_Record object is unserialized
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.
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.
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.
mixed | __call() | __call this method is a magic method that is being used for method overloading
void | __toString() | returns a string representation of this object
void | __unset() |

[ Top ]
Properties
static integer $_index = 1 [line 116]
API Tags:

Access: | private

[ Top ]
array $_data = array() [line 87]
API Tags:

Access: | protected

[ Top ]
Doctrine_Validator_ErrorStack $_errorStack [line 104]
API Tags:

Access: | protected

[ Top ]
Doctrine_Record_Filter $_filter [line 108]
API Tags:

Access: | protected

[ Top ]
integer $_id = array() [line 83]
API Tags:

Access: | protected

[ Top ]
array $_modified = array() [line 100]
API Tags:

Access: | protected

[ Top ]
Doctrine_Node_ $_node [line 79]
API Tags:

Access: | protected

[ Top ]
integer $_oid [line 120]
API Tags:

Access: | private

[ Top ]
array $_references = array() [line 112]
API Tags:

Access: | protected

[ Top ]
integer $_state [line 96]
API Tags:

See: | STATE_* constants
Access: | protected

[ Top ]
array $_values = array() [line 91]
API Tags:

Access: | protected

[ Top ]
Methods
static method _index [line 201]

`static integer _index( )`

_index

API Tags:

Access: | public

[ Top ]
Constructor __construct [line 133]

`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:

Access: | public

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

[ Top ]
assignDefaultValues [line 389]

`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:

Access: | public

[ Top ]
assignIdentifier [line 1252]

`void assignIdentifier( [integer $id = false] )`

assignIdentifier

Parameters:

integer | $id: |

API Tags:

Access: | public

[ Top ]
call [line 1387]

`Doctrine_Record call( string|array $callback, string $column, mixed 2 )`

call

Parameters:

string|array | $callback: | valid callback
string | $column: | column name
mixed | 2: | arg1 ... argN optional callback arguments

API Tags:

Access: | public

[ Top ]
cleanData [line 414]

`integer cleanData( &$data, array $data )`

cleanData

Parameters:

array | $data: | data array to be cleaned
| &$data: |

API Tags:

Access: | public

[ Top ]
columnCount [line 1108]

`integer columnCount( )`

alias for count()

API Tags:

Return: | the number of columns in this record
Access: | public

[ Top ]
construct [line 221]

`void construct( )`

construct Empty tempalte method to provide concrete Record classes with the possibility to hook into the constructor procedure

API Tags:

Access: | public

[ Top ]
contains [line 925]

`boolean contains( string $name )`

contains

Parameters:

string | $name: |

API Tags:

Access: | public

[ Top ]
copy [line 1203]

`Doctrine_Record copy( )`

copy returns a copy of this object

API Tags:

Access: | public

[ Top ]
copyDeep [line 1231]

`Doctrine_Record copyDeep( )`

copyDeep returns a copy of this object and all its related objects

API Tags:

Access: | public

[ Top ]
coreSetRelated [line 876]

`void coreSetRelated( $name, $value )`

Parameters:

| $name: |
| $value: |

API Tags:

Access: | public

[ Top ]
count [line 1099]

`integer count( )`

count this class implements countable interface

API Tags:

Return: | the number of columns in this record
Access: | public

Implementation of:

Countable::count

[ Top ]
delete [line 1190]

`boolean delete( [Doctrine_Connection $conn = null] )`

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:

Doctrine_Connection | $conn: |

API Tags:

Return: | true on success, false on failure
Access: | public

[ Top ]
deleteNode [line 1516]

`void deleteNode( )`

used to delete node from tree - MUST BE USE TO DELETE RECORD IF TABLE ACTS AS TREE

API Tags:

Access: | public

[ Top ]
errorStack [line 371]

`void|Doctrine_Validator_ErrorStack errorStack( [Doctrine_Validator_ErrorStack $stack = null] )`

errorStack assigns / returns record errorStack

Parameters:

Doctrine_Validator_ErrorStack | $stack: | errorStack to be assigned for this record

API Tags:

Return: | returns the errorStack associated with this record
Access: | public

[ Top ]
exists [line 1146]

`boolean exists( )`

exists returns true if this record is persistent, otherwise false

API Tags:

Access: | public

[ Top ]
get [line 753]

`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:

Access: | public

Information Tags:

Throws: | Doctrine_Record_Exception if trying to get a value of unknown property / related component

Redefined in descendants as:

- Doctrine_File::get()

[ Top ]
getData [line 701]

`array getData( )`

getData return all the internal data

API Tags:

Return: | an array containing all the properties
Access: | public

[ Top ]
getErrorStack [line 360]

`Doctrine_Validator_ErrorStack getErrorStack( )`

getErrorStack

API Tags:

Return: | returns the errorStack associated with this record
Access: | public

[ Top ]
getIncremented [line 1285]

`integer getIncremented( )`

returns the value of autoincremented primary key of this object (if any)

API Tags:

Access: | public

[ Top ]
getIterator [line 1178]

`Doctrine_Record_Iterator getIterator( )`

getIterator

API Tags:

Return: | a Doctrine_Record_Iterator that iterates through the data
Access: | public

Implementation of:

IteratorAggregate::getIterator

[ Top ]
getLast [line 1302]

`Doctrine_Record getLast( )`

getLast

this method is used internally be Doctrine_Query it is needed to provide compatibility between records and collections

API Tags:

Access: | public

[ Top ]
getModified [line 1020]

`array getModified( )`

returns an array of modified fields and associated values

API Tags:

Access: | public

[ Top ]
getNode [line 1407]

`mixed getNode( )`

getter for node assciated with this record

API Tags:

Return: | if tree returns Doctrine_Node otherwise returns false
Access: | public

[ Top ]
getOid [line 229]

`integer getOid( )`

getOid returns the object identifier

API Tags:

Access: | public

[ Top ]
getPrepared [line 1038]

`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:

array | $array: |

API Tags:

Access: | public

[ Top ]
getReferences [line 1332]

`array getReferences( )`

getReferences

API Tags:

Return: | all references
Access: | public

[ Top ]
getTable [line 691]

`object Doctrine_Table getTable( )`

getTable returns the table object for this record

API Tags:

Return: | a Doctrine_Table object
Access: | public

[ Top ]
hasReference [line 1311]

`boolean hasReference( string $name )`

hasRefence

Parameters:

string | $name: |

API Tags:

Access: | public

[ Top ]
hasRelation [line 1167]

`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:

Access: | public

[ Top ]
hydrate [line 437]

`boolean hydrate( $data )`

hydrate hydrates this object from given array

Parameters:

array | $data: |

API Tags:

Access: | public

[ Top ]
identifier [line 1276]

`array identifier( )`

returns the primary keys of this object

API Tags:

Access: | public

[ Top ]
isModified [line 1157]

`boolean isModified( )`

isModified returns true if this record was modified, otherwise false

API Tags:

Access: | public

[ Top ]
isValid [line 238]

`boolean isValid( )`

isValid

API Tags:

Return: | whether or not this record passes all column validations
Access: | public

[ Top ]
load [line 732]

`boolean load( )`

load loads all the unitialized properties from the database

API Tags:

Access: | public

[ Top ]
loadReference [line 1354]

`void loadReference( string $name )`

loadReference loads a related component

Parameters:

string | $name: |

API Tags:

Access: | public

Information Tags:

Throws: | Doctrine_Table_Exception if trying to load an unknown related component

[ Top ]
mapValue [line 809]

`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:

Access: | public

[ Top ]
merge [line 1367]

`void merge( $values )`

merge merges this record with an array of values

Parameters:

array | $values: |

API Tags:

Access: | public

[ Top ]
obtainReference [line 1321]

`void obtainReference( string $name )`

obtainReference

Parameters:

string | $name: |

API Tags:

Access: | public

Information Tags:

Throws: | Doctrine_Record_Exception if trying to get an unknown related component

[ Top ]
postDelete [line 325]

`void postDelete( $event )`

Empty template method to provide concrete Record classes with the possibility to hook into the deletion procedure.

Parameters:

| $event: |

API Tags:

Access: | public

[ Top ]
postInsert [line 353]

`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:

| $event: |

API Tags:

Access: | public

[ Top ]
postSave [line 313]

`void postSave( $event )`

Empty template method to provide concrete Record classes with the possibility to hook into the saving procedure.

Parameters:

| $event: |

API Tags:

Access: | public

[ Top ]
postSerialize [line 289]

`void postSerialize( $event )`

Empty template method to provide concrete Record classes with the possibility to hook into the serializing procedure.

Parameters:

| $event: |

API Tags:

Access: | public

[ Top ]
postUnserialize [line 301]

`void postUnserialize( $event )`

Empty template method to provide concrete Record classes with the possibility to hook into the serializing procedure.

Parameters:

| $event: |

API Tags:

Access: | public

[ Top ]
postUpdate [line 339]

`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:

| $event: |

API Tags:

Access: | public

[ Top ]
preDelete [line 319]

`void preDelete( $event )`

Empty template method to provide concrete Record classes with the possibility to hook into the deletion procedure.

Parameters:

| $event: |

API Tags:

Access: | public

[ Top ]
preInsert [line 346]

`void preInsert( $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:

| $event: |

API Tags:

Access: | public

[ Top ]
prepareIdentifiers [line 451]

`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:

Access: | private

[ Top ]
preSave [line 307]

`void preSave( $event )`

Empty template method to provide concrete Record classes with the possibility to hook into the saving procedure.

Parameters:

| $event: |

API Tags:

Access: | public

[ Top ]
preSerialize [line 283]

`void preSerialize( $event )`

Empty template method to provide concrete Record classes with the possibility to hook into the serializing procedure.

Parameters:

| $event: |

API Tags:

Access: | public

[ Top ]
preUnserialize [line 295]

`void preUnserialize( $event )`

Empty template method to provide concrete Record classes with the possibility to hook into the serializing procedure.

Parameters:

| $event: |

API Tags:

Access: | public

[ Top ]
preUpdate [line 332]

`void preUpdate( $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:

| $event: |

API Tags:

Access: | public

[ Top ]
rawGet [line 715]

`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:

Access: | public

Information Tags:

Throws: | Doctrine_Record_Exception if trying to get an unknown property

[ Top ]
refresh [line 634]

`boolean refresh( )`

refresh refresh internal data from the database

API Tags:

Access: | public

Information Tags:

Throws: | Doctrine_Record_Exception When the refresh operation fails (when the database row this record represents does not exist anymore)

[ Top ]
refreshRelated [line 673]

`Doctrine_Record refreshRelated( [string $name = null] )`

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

[ Top ]
replace [line 1008]

`integer replace( [Doctrine_Connection $conn = null] )`

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:

Doctrine_Connection | $conn: | optional connection parameter

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

[ Top ]
revert [line 1431]

`Doctrine_Record revert( integer $version )`

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

[ Top ]
save [line 966]

`void save( [Doctrine_Connection $conn = null] )`

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:

Doctrine_Connection | $conn: | optional connection parameter

API Tags:

Access: | public

[ Top ]
serialize [line 484]

`array serialize( )`

serialize this method is automatically called when this Doctrine_Record is serialized

API Tags:

Access: | public

Implementation of:

Serializable::serialize

[ Top ]
set [line 828]

`Doctrine_Record set( mixed $name, mixed $value, [boolean $load = true] )`

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:

Access: | public

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

[ Top ]
setRelated [line 1342]

`void setRelated( string $alias, Doctrine_Access $coll )`

setRelated

Parameters:

string | $alias: |
Doctrine_Access | $coll: |

API Tags:

Access: | public

[ Top ]
setUp [line 212]

`void setUp( )`

setUp this method is used for setting up relations and attributes it should be implemented by child classes

API Tags:

Access: | public

Redefined in descendants as:

- Doctrine_File_Index::setUp()
- Doctrine_File::setUp()

[ Top ]
state [line 593]

`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

[ Top ]
toArray [line 1119]

`array toArray( [boolean $deep = false] )`

toArray returns the record as an array

Parameters:

boolean | $deep: | - Return also the relations

API Tags:

Access: | public

[ Top ]
toString [line 1519]

`void toString( )`

API Tags:

Access: | public

[ Top ]
trySave [line 982]

`TRUE trySave( [Doctrine_Connection $conn = null] )`

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:

Doctrine_Connection | $conn: | optional connection parameter

API Tags:

Return: | if the record was saved sucessfully without errors, FALSE otherwise.
Access: | public

[ Top ]
unlink [line 1454]

`Doctrine_Record unlink( string $alias, array $ids )`

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

[ Top ]
unserialize [line 537]

`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:

Access: | public

Information Tags:

Throws: | Doctrine_Record_Exception if the cleanData operation fails somehow

Implementation of:

Serializable::unserialize

[ Top ]
validate [line 263]

`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.

API Tags:

Access: | protected

[ Top ]
validateOnInsert [line 277]

`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.

API Tags:

Access: | protected

[ Top ]
validateOnUpdate [line 270]

`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.

API Tags:

Access: | protected

[ Top ]
__call [line 1502]

`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

[ Top ]
__toString [line 1526]

`void __toString( )`

returns a string representation of this object

API Tags:

Access: | public

[ Top ]
__unset [line 949]

`void __unset( string $name )`

Parameters:

string | $name: |

API Tags:

Access: | public

Redefinition of:

Doctrine_Access::__unset()
  __unset()

[ Top ]
Constants
STATE_CLEAN = 3 [line 56]

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

[ Top ]
STATE_DIRTY = 1 [line 44]

DIRTY STATE

a Doctrine_Record is in dirty state when its properties are changed

[ Top ]
STATE_LOCKED = 6 [line 74]

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

[ Top ]
STATE_PROXY = 4 [line 61]

PROXY STATE

a Doctrine_Record is in proxy state when its properties are not fully loaded

[ Top ]
STATE_TCLEAN = 5 [line 66]

NEW TCLEAN

a Doctrine_Record is in transient clean state when it is created and none of its fields are modified

[ Top ]
STATE_TDIRTY = 2 [line 50]

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

[ Top ]