PHP 클래스 Doctrine_Record, ZFPlanet

부터: 1.0
저자: Konsta Vesterinen ([email protected])
상속: extends Doctrine_Record_Abstract, implements Countable, implements IteratorAggregate, implements Serializable
파일 보기 프로젝트 열기: padraic/ZFPlanet 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_customAccessors array Array of custom accessors for cache
$_customMutators array Array of custom mutators for cache
$_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
$_errorStack error stack object
$_id integer the primary keys of this object
$_invokedSaveHooks array Array containing the save hooks and events that have been invoked
$_lastModified array an array containing field names that were modified in the previous transaction
$_modified array an array containing field names that have been modified
$_node
$_oldValues array an array of the old values from set properties
$_pendingDeletes string Doctrine_Collection of objects needing to be deleted on save
$_pendingUnlinks array Array of pending un links in format alias => keys to be executed after save
$_references array an array containing all the references
$_serializeReferences boolean Whether or not to serialize references when a Doctrine_Record is serialized
$_state integer the state of this record
$_values array the values array, aggregate values and such are mapped into this array

공개 메소드들

메소드 설명
__call ( string $method, array $args ) : mixed magic method used for method overloading
__construct ( Doctrine_Table | null $table = null, boolean $isNewEntry = false ) constructor
__toString ( ) : string magic method
__unset ( string $name ) : void deletes a column or a related component.
_index ( ) : integer the current instance counter used to generate unique ids for php objects. Contains the next identifier.
assignDefaultValues ( boolean $overwrite = false ) : boolean setDefaultValues sets the default values for records internal data
assignIdentifier ( mixed $id = false ) : void assigns an identifier to the instance, for database storage
assignInheritanceValues ( ) : void Assign the inheritance column values
call ( string | array $callback, string $column ) : Doctrine_Record call
cleanData ( array &$data ) : array 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.
clearAccessor ( string $fieldName ) : void clears the accessor for a field name
clearInvokedSaveHooks ( ) makes all the already used save hooks available again
clearMutator ( string $fieldName ) : void clears the custom mutator for a field name
clearRelated ( string $name = null ) : void Clear a related reference or all references
columnCount ( ) : integer alias for @see count()
construct ( ) : void construct Empty template method to provide concrete Record classes with the possibility to hook into the constructor procedure
contains ( string $fieldName ) : boolean test whether a field (column, mapped value, related component) is accessible by @see get()
copy ( boolean $deep = false ) : Doctrine_Record generates a copy of this object. Returns an instance of the same class of $this.
coreSetRelated ( string $name, Doctrine_Record | Doctrine_Collection $value ) Places a related component in the object graph.
count ( ) : integer implements Countable interface
delete ( Doctrine_Connection $conn = null ) : boolean deletes this data access object and all the related composites this operation is isolated by a transaction
deleteNode ( ) used to delete node from tree - MUST BE USE TO DELETE RECORD IF TABLE ACTS AS TREE
errorStack ( $stack = null ) : void | Doctrine_Validator_ErrorStack assigns the ErrorStack or returns it if called without parameters
exists ( ) : boolean returns true if this record is saved in the database, otherwise false (it is transient)
exportTo ( string $type, string $deep = true ) : string exports instance to a chosen format
free ( boolean $deep = false ) Helps freeing the memory occupied by the entity.
fromArray ( array $array, boolean $deep = true ) : void imports data from a php array
get ( mixed $fieldName, boolean $load = true ) : mixed returns a value of a property or a related component
getAccessor ( string $fieldName ) : string gets the custom accessor for a field name
getAccessors ( ) : array gets all accessors for this component instance
getData ( ) : array return all the internal data (columns)
getErrorStack ( ) : Doctrine_Validator_ErrorStack retrieves the ErrorStack. To be called after a failed validation attempt (@see isValid()).
getErrorStackAsString ( ) : string Get the record error stack as a human readable string.
getIncremented ( ) : integer returns the value of autoincremented primary key of this object (if any)
getIterator ( ) : Doctrine_Record_Iterator implements IteratorAggregate interface
getLast ( ) : Doctrine_Record getLast this method is used internally by Doctrine_Query it is needed to provide compatibility between records and collections
getLastModified ( boolean $old = false ) : array returns an array of the modified fields from the last transaction.
getModified ( boolean $old = false, boolean $last = false ) : array retrieves an array of modified fields and associated new values.
getMutator ( $fieldName ) : string gets the custom mutator for a field name
getMutators ( ) : array gets all custom mutators for this component instance
getNode ( ) : Doctrine_Node getter for node associated with this record
getOid ( ) : integer
getPendingDeletes ( ) : array returns Doctrine_Record instances which need to be deleted on save
getPendingUnlinks ( ) : array returns Doctrine_Record instances which need to be unlinked (deleting the relation) on save
getPrepared ( array $array = [] ) : array Retrieves data prepared for a sql transaction.
getReferences ( ) : array get all related components
getTable ( ) : Doctrine_Table returns the table object for this record.
hasAccessor ( string $fieldName, string $accessor = null ) : boolean sets a fieldname to have a custom accessor or check if a field has a custom accessor defined (when called without $accessor parameter).
hasAccessorMutator ( $fieldName, string $accessor, string $mutator ) Set a fieldname to have a custom accessor and mutator
hasMappedValue ( string $name ) : boolean Tests whether a mapped value exists
hasMutator ( string $fieldName, string $mutator = null ) : boolean sets a fieldname to have a custom mutator or check if a field has a custom mutator defined (when called without the $mutator parameter)
hasReference ( string $name ) : boolean tests whether a relation is set
hasRelation ( mixed $fieldName ) : boolean checks existence of properties and related components
hydrate ( array $data, boolean $overwriteLocalChanges = true ) : void hydrate hydrates this object from given array
identifier ( ) : array returns the primary keys of this object
importFrom ( string $type, string $data, $deep = true ) : void imports data from a chosen format in the current instance
invokeSaveHooks ( string $when, string $type, Doctrine_Event $event = null ) : Doctrine_Event calls a subclass hook. Idempotent until @see clearInvokedSaveHooks() is called.
isInProxyState ( ) : boolean indicates whether record has any not loaded fields
isModified ( boolean $deep = false ) : boolean returns true if this record was modified, otherwise false
isValid ( boolean $deep = false, boolean $hooks = true ) : boolean tests validity of the record using the current data.
link ( string $alias, array $ids, boolean $now = false ) : Doctrine_Record creates links from this record to given records
linkInDb ( string $alias, array $ids ) : Doctrine_Record creates links from this record to given records now, querying the db
load ( array $data = [] ) : boolean loads all the uninitialized properties from the database.
loadReference ( string $name ) : void loadReference loads a related component
mapValue ( string $name, mixed $value = null ) : void sets a value that will be managed as if it were a field by magic accessor and mutators, @see get() and @see set().
merge ( $data, boolean $deep = true ) : void merges this record with an array of values or with another existing instance of this object
obtainReference ( string $name ) gets a related component and fails if it does not exist
oid ( )
postDelete ( $event ) Empty template method to provide concrete Record classes with the possibility to hook into the deletion procedure.
postHydrate ( $event ) Empty template method to provide Record classes with the ability to alter hydration after it runs
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.
postSave ( $event ) Empty template method to provide concrete Record classes with the possibility to hook into the saving procedure.
postSerialize ( $event ) Empty template method to provide concrete Record classes with the possibility to hook into the serializing procedure.
postUnserialize ( $event ) Empty template method to provide concrete Record classes with the possibility to hook into the serializing procedure.
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.
postValidate ( $event ) Empty template method to provide concrete Record classes with the possibility to hook into the validation procedure.
preDelete ( $event ) Empty template method to provide concrete Record classes with the possibility to hook into the deletion procedure.
preDqlDelete ( $event ) Empty template method to provide Record classes with the ability to alter DQL delete queries at runtime
preDqlSelect ( $event ) Empty template method to provide Record classes with the ability to alter DQL select queries at runtime
preDqlUpdate ( $event ) Empty template method to provide Record classes with the ability to alter DQL update queries at runtime
preHydrate ( $event ) Empty template method to provide Record classes with the ability to alter hydration before it runs
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.
preSave ( $event ) Empty template method to provide concrete Record classes with the possibility to hook into the saving procedure.
preSerialize ( $event ) Empty template method to provide concrete Record classes with the possibility to hook into the serializing procedure.
preUnserialize ( $event ) Empty template method to provide concrete Record classes with the possibility to hook into the serializing procedure.
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.
preValidate ( $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.
rawGet ( $fieldName ) : mixed returns the value of a property (column). If the property is not yet loaded this method does NOT load it.
reference ( string $name ) : Doctrine_Record | Doctrine_Collection gets a related component
refresh ( boolean $deep = false ) : boolean refresh refresh internal data from the database
refreshRelated ( string $name = null ) : Doctrine_Record refresh refresh data of related objects from the database
relatedExists ( string $name ) : boolean 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.
replace ( Doctrine_Connection $conn = null ) : integer 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.
resetPendingUnlinks ( ) : void resets pending record unlinks
save ( Doctrine_Connection $conn = null ) : void 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
serialize ( ) : string serialize this method is automatically called when an instance of Doctrine_Record is serialized
serializeReferences ( boolean $bool = null ) : boolean Set whether or not to serialize references.
set ( $fieldName, mixed $value, boolean $load = true ) : Doctrine_Record alters mapped values, properties and related components.
setRelated ( string $alias, Doctrine_Access $coll ) set a related component
setUp ( ) : void setUp this method is used for setting up relations and attributes it should be implemented by child classes
state ( integer | string $state = null ) : null | integer assigns the state of this record or returns it if called without parameters
synchronizeWithArray ( array $array, boolean $deep = true ) synchronizes a Doctrine_Record instance and its relations with data from an array
toArray ( boolean $deep = true, boolean $prefixKey = false ) : array returns the record representation as an array
toString ( ) : string __toString alias
trySave ( Doctrine_Connection $conn = null ) : TRUE tries to save the object and all its related components.
unlink ( string $alias, array $ids = [], boolean $now = false ) : Doctrine_Record unlink removes links from this record to given records if no ids are given, it removes all links
unlinkInDb ( string $alias, array $ids = [] ) : Doctrine_Record unlink now the related components, querying the db
unserialize ( string $serialized ) : void this method is automatically called everytime an instance is unserialized
unshiftFilter ( Doctrine_Record_Filter $filter )

보호된 메소드들

메소드 설명
_get ( $fieldName, $load = true )
_isValueModified ( string $type, string $old, string $new ) : boolean Check if a value has changed according to Doctrine Doctrine is loose with type checking in the same ways PHP is for consistancy of behavior
_resetModified ( ) : void Reset the modified array and store the old array in lastModified so it can be accessed by users after saving a record, since the modified array is reset after the object is saved.
_set ( $fieldName, $value, $load = true )
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.
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.
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.

비공개 메소드들

메소드 설명
prepareIdentifiers ( boolean $exists = true ) : void prepareIdentifiers prepares identifiers for later use

메소드 상세

__call() 공개 메소드

the function of this method is to try to find a given method from the templates (behaviors) the record is using, and if found, execute it. Note that already existing methods would not be overloaded. So, in sense, this method replicates the usage of mixins (as seen in some programming languages)
public __call ( string $method, array $args ) : mixed
$method string name of the method
$args array method arguments
리턴 mixed the return value of the given method

__construct() 공개 메소드

constructor
public __construct ( Doctrine_Table | null $table = null, boolean $isNewEntry = false )
$table Doctrine_Table | null a Doctrine_Table object or null, if null the table object is retrieved from current connection
$isNewEntry boolean whether or not this record is transient

__toString() 공개 메소드

magic method
public __toString ( ) : string
리턴 string representation of this object

__unset() 공개 메소드

deletes a column or a related component.
public __unset ( string $name ) : void
$name string
리턴 void

_get() 보호된 메소드

protected _get ( $fieldName, $load = true )

_index() 공개 정적인 메소드

the current instance counter used to generate unique ids for php objects. Contains the next identifier.
public static _index ( ) : integer
리턴 integer

_isValueModified() 보호된 메소드

This function basically says if what is being set is of Doctrine type boolean and something like current_value == 1 && new_value = true would not be considered modified Simply doing $old !== $new will return false for boolean columns would mark the field as modified and change it in the database when it is not necessary
protected _isValueModified ( string $type, string $old, string $new ) : boolean
$type string Doctrine type of the column
$old string Old value
$new string New value
리턴 boolean $modified Whether or not Doctrine considers the value modified

_resetModified() 보호된 메소드

Reset the modified array and store the old array in lastModified so it can be accessed by users after saving a record, since the modified array is reset after the object is saved.
protected _resetModified ( ) : void
리턴 void

_set() 보호된 메소드

protected _set ( $fieldName, $value, $load = true )

assignDefaultValues() 공개 메소드

setDefaultValues sets the default values for records internal data
public assignDefaultValues ( boolean $overwrite = false ) : boolean
$overwrite boolean whether or not to overwrite the already set values
리턴 boolean

assignIdentifier() 공개 메소드

assigns an identifier to the instance, for database storage
public assignIdentifier ( mixed $id = false ) : void
$id mixed a key value or an array of keys
리턴 void

assignInheritanceValues() 공개 메소드

Assign the inheritance column values
public assignInheritanceValues ( ) : void
리턴 void

call() 공개 메소드

call
public call ( string | array $callback, string $column ) : Doctrine_Record
$callback string | array valid callback
$column string column name
리턴 Doctrine_Record provides a fluent interface

cleanData() 공개 메소드

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 cleanData ( array &$data ) : array
$data array data array to be cleaned
리턴 array values cleaned from data

clearAccessor() 공개 메소드

clears the accessor for a field name
public clearAccessor ( string $fieldName ) : void
$fieldName string
리턴 void

clearInvokedSaveHooks() 공개 메소드

makes all the already used save hooks available again

clearMutator() 공개 메소드

clears the custom mutator for a field name
public clearMutator ( string $fieldName ) : void
$fieldName string
리턴 void

clearRelated() 공개 메소드

Clear a related reference or all references
public clearRelated ( string $name = null ) : void
$name string The relationship reference to clear
리턴 void

columnCount() 공개 메소드

alias for @see count()
public columnCount ( ) : integer
리턴 integer the number of columns in this record

construct() 공개 메소드

construct Empty template method to provide concrete Record classes with the possibility to hook into the constructor procedure
public construct ( ) : void
리턴 void

contains() 공개 메소드

test whether a field (column, mapped value, related component) is accessible by @see get()
public contains ( string $fieldName ) : boolean
$fieldName string
리턴 boolean

copy() 공개 메소드

generates a copy of this object. Returns an instance of the same class of $this.
public copy ( boolean $deep = false ) : Doctrine_Record
$deep boolean whether to duplicates the objects targeted by the relations
리턴 Doctrine_Record

coreSetRelated() 공개 메소드

This method inserts a related component instance in this record relations, populating the foreign keys accordingly.
public coreSetRelated ( string $name, Doctrine_Record | Doctrine_Collection $value )
$name string related component alias in the relation
$value Doctrine_Record | Doctrine_Collection object to be linked as a related component

count() 공개 메소드

implements Countable interface
public count ( ) : integer
리턴 integer the number of columns in this record

delete() 공개 메소드

this event can be listened by the onPreDelete and onDelete listeners
public delete ( Doctrine_Connection $conn = null ) : boolean
$conn Doctrine_Connection
리턴 boolean true if successful

deleteNode() 공개 메소드

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

errorStack() 공개 메소드

assigns the ErrorStack or returns it if called without parameters
public errorStack ( $stack = null ) : void | Doctrine_Validator_ErrorStack
리턴 void | Doctrine_Validator_ErrorStack returns the errorStack associated with this record

exists() 공개 메소드

returns true if this record is saved in the database, otherwise false (it is transient)
public exists ( ) : boolean
리턴 boolean

exportTo() 공개 메소드

exports instance to a chosen format
public exportTo ( string $type, string $deep = true ) : string
$type string format type: array, xml, yml, json
$deep string whether or not to export all relationships
리턴 string representation as $type format. Array is $type is array

free() 공개 메소드

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 free ( boolean $deep = false )
$deep boolean whether to free also the related components

fromArray() 공개 메소드

imports data from a php array
public fromArray ( array $array, boolean $deep = true ) : void
$array array array of data, see link for documentation
$deep boolean whether or not to act on relations
리턴 void

get() 공개 메소드

returns a value of a property or a related component
public get ( mixed $fieldName, boolean $load = true ) : mixed
$fieldName mixed name of the property or related component
$load boolean whether or not to invoke the loading procedure
리턴 mixed

getAccessor() 공개 메소드

gets the custom accessor for a field name
public getAccessor ( string $fieldName ) : string
$fieldName string
리턴 string $accessor

getAccessors() 공개 메소드

gets all accessors for this component instance
public getAccessors ( ) : array
리턴 array $accessors

getData() 공개 메소드

return all the internal data (columns)
public getData ( ) : array
리턴 array an array containing all the properties

getErrorStack() 공개 메소드

retrieves the ErrorStack. To be called after a failed validation attempt (@see isValid()).
public getErrorStack ( ) : Doctrine_Validator_ErrorStack
리턴 Doctrine_Validator_ErrorStack returns the errorStack associated with this record

getErrorStackAsString() 공개 메소드

Useful for outputting errors to user via web browser
public getErrorStackAsString ( ) : string
리턴 string $message

getIncremented() 최종 공개 메소드

returns the value of autoincremented primary key of this object (if any)
final public getIncremented ( ) : integer
리턴 integer

getIterator() 공개 메소드

implements IteratorAggregate interface
public getIterator ( ) : Doctrine_Record_Iterator
리턴 Doctrine_Record_Iterator iterator through data

getLast() 공개 메소드

getLast this method is used internally by Doctrine_Query it is needed to provide compatibility between records and collections
public getLast ( ) : Doctrine_Record
리턴 Doctrine_Record

getLastModified() 공개 메소드

returns an array of the modified fields from the last transaction.
public getLastModified ( boolean $old = false ) : array
$old boolean pick the old values (instead of the new ones)
리턴 array

getModified() 공개 메소드

retrieves an array of modified fields and associated new values.
public getModified ( boolean $old = false, boolean $last = false ) : array
$old boolean pick the old values (instead of the new ones)
$last boolean pick only lastModified values (@see getLastModified())
리턴 array $a

getMutator() 공개 메소드

gets the custom mutator for a field name
public getMutator ( $fieldName ) : string
리턴 string

getMutators() 공개 메소드

gets all custom mutators for this component instance
public getMutators ( ) : array
리턴 array $mutators

getNode() 공개 메소드

getter for node associated with this record
public getNode ( ) : Doctrine_Node
리턴 Doctrine_Node false if component is not a Tree

getOid() 공개 메소드

public getOid ( ) : integer
리턴 integer the object identifier

getPendingDeletes() 공개 메소드

returns Doctrine_Record instances which need to be deleted on save
public getPendingDeletes ( ) : 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.
public getPrepared ( array $array = [] ) : array
$array array
리턴 array

getReferences() 공개 메소드

get all related components
public getReferences ( ) : array
리턴 array various Doctrine_Collection or Doctrine_Record instances

getTable() 공개 메소드

returns the table object for this record.
public getTable ( ) : Doctrine_Table
리턴 Doctrine_Table a Doctrine_Table object

hasAccessor() 공개 메소드

sets a fieldname to have a custom accessor or check if a field has a custom accessor defined (when called without $accessor parameter).
public hasAccessor ( string $fieldName, string $accessor = null ) : boolean
$fieldName string
$accessor string
리턴 boolean

hasAccessorMutator() 공개 메소드

Set a fieldname to have a custom accessor and mutator
public hasAccessorMutator ( $fieldName, string $accessor, string $mutator )
$accessor string
$mutator string

hasMappedValue() 공개 메소드

Tests whether a mapped value exists
public hasMappedValue ( string $name ) : boolean
$name string the name of the property
리턴 boolean

hasMutator() 공개 메소드

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 hasMutator ( string $fieldName, string $mutator = null ) : boolean
$fieldName string
$mutator string
리턴 boolean

hasReference() 공개 메소드

tests whether a relation is set
public hasReference ( string $name ) : boolean
$name string relation alias
리턴 boolean

hasRelation() 공개 메소드

checks existence of properties and related components
public hasRelation ( mixed $fieldName ) : boolean
$fieldName mixed name of the property or reference
리턴 boolean

hydrate() 공개 메소드

hydrate hydrates this object from given array
public hydrate ( array $data, boolean $overwriteLocalChanges = true ) : void
$data array
$overwriteLocalChanges boolean whether to overwrite the unsaved (dirty) data
리턴 void

identifier() 공개 메소드

returns the primary keys of this object
public identifier ( ) : array
리턴 array

importFrom() 공개 메소드

imports data from a chosen format in the current instance
public importFrom ( string $type, string $data, $deep = true ) : void
$type string Format type: xml, yml, json
$data string Data to be parsed and imported
리턴 void

invokeSaveHooks() 공개 메소드

$this->invokeSaveHooks('pre', 'save');
public invokeSaveHooks ( string $when, string $type, Doctrine_Event $event = null ) : Doctrine_Event
$when string 'post' or 'pre'
$type string serialize, unserialize, save, delete, update, insert, validate, dqlSelect, dqlDelete, hydrate
$event Doctrine_Event event raised
리턴 Doctrine_Event the event generated using the type, if not specified

isInProxyState() 공개 메소드

indicates whether record has any not loaded fields
public isInProxyState ( ) : boolean
리턴 boolean

isModified() 공개 메소드

returns true if this record was modified, otherwise false
public isModified ( boolean $deep = false ) : boolean
$deep boolean whether to process also the relations for changes
리턴 boolean

isValid() 공개 메소드

tests validity of the record using the current data.
public isValid ( boolean $deep = false, boolean $hooks = true ) : boolean
$deep boolean run the validation process on the relations
$hooks boolean invoke save hooks before start
리턴 boolean whether or not this record is valid

linkInDb() 공개 메소드

creates links from this record to given records now, querying the db
public linkInDb ( string $alias, array $ids ) : Doctrine_Record
$alias string related component alias
$ids array the identifiers of the related records
리턴 Doctrine_Record this object (fluent interface)

load() 공개 메소드

Used to move a record from PROXY to CLEAN/DIRTY state.
public load ( array $data = [] ) : boolean
$data array overwriting data to load in the record. Instance is hydrated from the table if not specified.
리턴 boolean

loadReference() 공개 메소드

loadReference loads a related component
public loadReference ( string $name ) : void
$name string alias of the relation
리턴 void

mapValue() 공개 메소드

Normally used by Doctrine for the mapping of aggregate values.
public mapValue ( string $name, mixed $value = null ) : void
$name string the name of the mapped value
$value mixed mixed value to be mapped
리턴 void

merge() 공개 메소드

merges this record with an array of values or with another existing instance of this object
public merge ( $data, boolean $deep = true ) : void
$deep boolean whether or not to merge relations
리턴 void

obtainReference() 공개 메소드

gets a related component and fails if it does not exist
public obtainReference ( string $name )
$name string

oid() 공개 메소드

public oid ( )

postDelete() 공개 메소드

Empty template method to provide concrete Record classes with the possibility to hook into the deletion procedure.
public postDelete ( $event )

postHydrate() 공개 메소드

Empty template method to provide Record classes with the ability to alter hydration after it runs
public postHydrate ( $event )

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.
public postInsert ( $event )

postSave() 공개 메소드

Empty template method to provide concrete Record classes with the possibility to hook into the saving procedure.
public postSave ( $event )

postSerialize() 공개 메소드

Empty template method to provide concrete Record classes with the possibility to hook into the serializing procedure.
public postSerialize ( $event )

postUnserialize() 공개 메소드

Empty template method to provide concrete Record classes with the possibility to hook into the serializing procedure.
public postUnserialize ( $event )

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.
public postUpdate ( $event )

postValidate() 공개 메소드

Empty template method to provide concrete Record classes with the possibility to hook into the validation procedure.
public postValidate ( $event )

preDelete() 공개 메소드

Empty template method to provide concrete Record classes with the possibility to hook into the deletion procedure.
public preDelete ( $event )

preDqlDelete() 공개 메소드

Empty template method to provide Record classes with the ability to alter DQL delete queries at runtime
public preDqlDelete ( $event )

preDqlSelect() 공개 메소드

Empty template method to provide Record classes with the ability to alter DQL select queries at runtime
public preDqlSelect ( $event )

preDqlUpdate() 공개 메소드

Empty template method to provide Record classes with the ability to alter DQL update queries at runtime
public preDqlUpdate ( $event )

preHydrate() 공개 메소드

Empty template method to provide Record classes with the ability to alter hydration before it runs
public preHydrate ( $event )

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.
public preInsert ( $event )

preSave() 공개 메소드

Empty template method to provide concrete Record classes with the possibility to hook into the saving procedure.
public preSave ( $event )

preSerialize() 공개 메소드

Empty template method to provide concrete Record classes with the possibility to hook into the serializing procedure.
public preSerialize ( $event )

preUnserialize() 공개 메소드

Empty template method to provide concrete Record classes with the possibility to hook into the serializing procedure.
public preUnserialize ( $event )

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.
public preUpdate ( $event )

preValidate() 공개 메소드

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 preValidate ( $event )

rawGet() 공개 메소드

returns the value of a property (column). If the property is not yet loaded this method does NOT load it.
public rawGet ( $fieldName ) : mixed
리턴 mixed

reference() 공개 메소드

gets a related component
public reference ( string $name ) : Doctrine_Record | Doctrine_Collection
$name string
리턴 Doctrine_Record | Doctrine_Collection

refresh() 공개 메소드

refresh refresh internal data from the database
public refresh ( boolean $deep = false ) : boolean
$deep boolean If true, fetch also current relations. Caution: this deletes any aggregated values you may have queried beforee
리턴 boolean

refreshRelated() 공개 메소드

refresh refresh data of related objects from the database
public refreshRelated ( string $name = null ) : Doctrine_Record
$name string name of a related component. if set, this method only refreshes the specified related component
리턴 Doctrine_Record this object

relatedExists() 공개 메소드

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 relatedExists ( string $name ) : boolean
$name string
리턴 boolean Whether or not the related relationship exists

replace() 공개 메소드

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 replace ( Doctrine_Connection $conn = null ) : integer
$conn Doctrine_Connection optional connection parameter
리턴 integer number of rows affected

save() 공개 메소드

this method also saves the related components
public save ( Doctrine_Connection $conn = null ) : void
$conn Doctrine_Connection optional connection parameter
리턴 void

serialize() 공개 메소드

serialize this method is automatically called when an instance of Doctrine_Record is serialized
public serialize ( ) : string
리턴 string

serializeReferences() 공개 메소드

This is used by caching since we want to serialize references when caching but not when just normally serializing a instance
public serializeReferences ( boolean $bool = null ) : boolean
$bool boolean
리턴 boolean $bool

set() 공개 메소드

alters mapped values, properties and related components.
public set ( $fieldName, mixed $value, boolean $load = true ) : Doctrine_Record
$value mixed value of the property or reference
$load boolean whether or not to refresh / load the uninitialized record data
리턴 Doctrine_Record

setRelated() 최종 공개 메소드

set a related component
final public setRelated ( string $alias, Doctrine_Access $coll )
$alias string
$coll Doctrine_Access

setUp() 공개 메소드

setUp this method is used for setting up relations and attributes it should be implemented by child classes
public setUp ( ) : void
리턴 void

state() 공개 메소드

assigns the state of this record or returns it if called without parameters
public state ( integer | string $state = null ) : null | integer
$state integer | string if set, this method tries to set the record state to $state
리턴 null | integer

synchronizeWithArray() 공개 메소드

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 synchronizeWithArray ( array $array, boolean $deep = true )
$array array representation of a Doctrine_Record
$deep boolean whether or not to act on relations

toArray() 공개 메소드

returns the record representation as an array
public toArray ( boolean $deep = true, boolean $prefixKey = false ) : array
$deep boolean whether to include relations
$prefixKey boolean not used
리턴 array

toString() 공개 메소드

__toString alias
public toString ( ) : string
리턴 string

trySave() 공개 메소드

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 trySave ( Doctrine_Connection $conn = null ) : TRUE
$conn Doctrine_Connection optional connection parameter
리턴 TRUE if the record was saved sucessfully without errors, FALSE otherwise.

unlinkInDb() 공개 메소드

unlink now the related components, querying the db
public unlinkInDb ( string $alias, array $ids = [] ) : Doctrine_Record
$alias string related component alias
$ids array the identifiers of the related records
리턴 Doctrine_Record this object (fluent interface)

unserialize() 공개 메소드

this method is automatically called everytime an instance is unserialized
public unserialize ( string $serialized ) : void
$serialized string Doctrine_Record as serialized string
리턴 void

unshiftFilter() 공개 메소드

public unshiftFilter ( Doctrine_Record_Filter $filter )
$filter Doctrine_Record_Filter

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

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

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

프로퍼티 상세

$_customAccessors 보호되어 있는 정적으로 프로퍼티

Array of custom accessors for cache
protected static array $_customAccessors
리턴 array

$_customMutators 보호되어 있는 정적으로 프로퍼티

Array of custom mutators for cache
protected static array $_customMutators
리턴 array

$_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 array $_data
리턴 array

$_errorStack 보호되어 있는 프로퍼티

error stack object
protected $_errorStack

$_id 보호되어 있는 프로퍼티

the primary keys of this object
protected int $_id
리턴 integer

$_invokedSaveHooks 보호되어 있는 프로퍼티

Array containing the save hooks and events that have been invoked
protected array $_invokedSaveHooks
리턴 array

$_lastModified 보호되어 있는 프로퍼티

an array containing field names that were modified in the previous transaction
protected array $_lastModified
리턴 array

$_modified 보호되어 있는 프로퍼티

an array containing field names that have been modified
protected array $_modified
리턴 array

$_node 보호되어 있는 프로퍼티

protected $_node

$_oldValues 보호되어 있는 프로퍼티

an array of the old values from set properties
protected array $_oldValues
리턴 array

$_pendingDeletes 보호되어 있는 프로퍼티

Doctrine_Collection of objects needing to be deleted on save
protected string $_pendingDeletes
리턴 string

$_references 보호되어 있는 프로퍼티

an array containing all the references
protected array $_references
리턴 array

$_serializeReferences 보호되어 있는 프로퍼티

Whether or not to serialize references when a Doctrine_Record is serialized
protected bool $_serializeReferences
리턴 boolean

$_state 보호되어 있는 프로퍼티

the state of this record
protected int $_state
리턴 integer

$_values 보호되어 있는 프로퍼티

the values array, aggregate values and such are mapped into this array
protected array $_values
리턴 array