class Doctrine_Relation_Nest extends Doctrine_Relation_Association (View source)

Doctrine_Relation_Association_Self

Constants

ONE

constant for ONE_TO_ONE and MANY_TO_ONE relationships

MANY

constant for MANY_TO_MANY and ONE_TO_MANY relationships

Properties

protected array $definition from Doctrine_Relation
protected $_isRefClass from Doctrine_Relation

Methods

__construct(array $definition)

constructor

boolean
hasConstraint()

hasConstraint whether or not this relation has an explicit constraint

isDeferred()

No description

isDeferrable()

No description

isEqual()

No description

offsetExists($offset)

No description

offsetGet($offset)

No description

offsetSet($offset, $value)

No description

offsetUnset($offset)

No description

array
toArray()

toArray

string
getAlias()

getAlias returns the relation alias

integer
getType()

getType returns the relation type, either 0 or 1

boolean
isCascadeDelete()

Checks whether this relation cascades deletions to the related objects on the application level.

getTable()

getTable returns the foreign table object

string
getClass()

getClass returns the name of the related class

string
getLocal()

getLocal returns the name of the local column

getLocalFieldName()

getLocalFieldName returns the field name of the local column

string
getLocalColumnName()

getLocalColumnName returns the column name of the local column

string
getForeign()

getForeign returns the name of the foreignkey column where the localkey column is pointing at

getForeignFieldName()

getLocalFieldName returns the field name of the foreign column

string
getForeignColumnName()

getForeignColumnName returns the column name of the foreign column

boolean
isOneToOne()

isOneToOne returns whether or not this relation is a one-to-one relation

string
getRelationDql(integer $count, $context = 'record')

getRelationDql

string
getForeignKeyName()

Get the name of the foreign key for this relationship

string
getOrderBy(string $alias = null, boolean $columnNames = false)

Get the relationship orderby SQL/DQL

string
getOrderByStatement(string $alias = null, boolean $columnNames = false)

Get the relationship orderby statement

isRefClass()

No description

string
__toString()

__toString

getLocalRefColumnName()

getLocalRefColumnName returns the column name of the local reference column

getLocalRefFieldName()

getLocalRefFieldName returns the field name of the local reference column

getForeignRefColumnName()

getForeignRefColumnName returns the column name of the foreign reference column

getForeignRefFieldName()

getForeignRefFieldName returns the field name of the foreign reference column

Details

__construct(array $definition)

constructor

Parameters

array $definition an associative array with the following structure: name foreign key constraint name

     local                   the local field(s)

     foreign                 the foreign reference field(s)

     table                   the foreign table object

     localTable              the local table object

     refTable                the reference table object (if any)

     onDelete                referential delete action

     onUpdate                referential update action

     deferred                deferred constraint checking

     alias                   relation alias

     type                    the relation type, either Doctrine_Relation::ONE or Doctrine_Relation::MANY

     constraint              boolean value, true if the relation has an explicit referential integrity constraint

     foreignKeyName          the name of the dbms foreign key to create. Optional, if left blank Doctrine will generate one for you

The onDelete and onUpdate keys accept the following values:

CASCADE: Delete or update the row from the parent table and automatically delete or update the matching rows in the child table. Both ON DELETE CASCADE and ON UPDATE CASCADE are supported. Between two tables, you should not define several ON UPDATE CASCADE clauses that act on the same column in the parent table or in the child table.

SET NULL: Delete or update the row from the parent table and set the foreign key column or columns in the child table to NULL. This is valid only if the foreign key columns do not have the NOT NULL qualifier specified. Both ON DELETE SET NULL and ON UPDATE SET NULL clauses are supported.

NO ACTION: In standard SQL, NO ACTION means no action in the sense that an attempt to delete or update a primary key value is not allowed to proceed if there is a related foreign key value in the referenced table.

RESTRICT: Rejects the delete or update operation for the parent table. NO ACTION and RESTRICT are the same as omitting the ON DELETE or ON UPDATE clause.

SET DEFAULT

boolean hasConstraint()

hasConstraint whether or not this relation has an explicit constraint

Return Value

boolean

isDeferred()

isDeferrable()

isEqual()

offsetExists($offset)

Parameters

$offset

offsetGet($offset)

Parameters

$offset

offsetSet($offset, $value)

Parameters

$offset
$value

offsetUnset($offset)

Parameters

$offset

array toArray()

toArray

Return Value

array

final string getAlias()

getAlias returns the relation alias

Return Value

string

final integer getType()

getType returns the relation type, either 0 or 1

Return Value

integer

See also

Doctrine_Relation MANY_* and ONE_* constants

boolean isCascadeDelete()

Checks whether this relation cascades deletions to the related objects on the application level.

Return Value

boolean

final Doctrine_Table getTable()

getTable returns the foreign table object

Return Value

Doctrine_Table

final string getClass()

getClass returns the name of the related class

Return Value

string

final string getLocal()

getLocal returns the name of the local column

Return Value

string

final getLocalFieldName()

getLocalFieldName returns the field name of the local column

final string getLocalColumnName()

getLocalColumnName returns the column name of the local column

Return Value

string $columnName

final string getForeign()

getForeign returns the name of the foreignkey column where the localkey column is pointing at

Return Value

string

final getForeignFieldName()

getLocalFieldName returns the field name of the foreign column

final string getForeignColumnName()

getForeignColumnName returns the column name of the foreign column

Return Value

string $columnName

final boolean isOneToOne()

isOneToOne returns whether or not this relation is a one-to-one relation

Return Value

boolean

string getRelationDql(integer $count, $context = 'record')

getRelationDql

Parameters

integer $count
$context

Return Value

string

Doctrine_Record|Doctrine_Collection fetchRelatedFor(Doctrine_Record $record)

fetchRelatedFor

fetches a component related to given record

Parameters

Doctrine_Record $record

Return Value

Doctrine_Record|Doctrine_Collection

string getForeignKeyName()

Get the name of the foreign key for this relationship

Return Value

string $foreignKeyName

string getOrderBy(string $alias = null, boolean $columnNames = false)

Get the relationship orderby SQL/DQL

Parameters

string $alias The alias to use
boolean $columnNames Whether or not to use column names instead of field names

Return Value

string $orderBy

string getOrderByStatement(string $alias = null, boolean $columnNames = false)

Get the relationship orderby statement

Parameters

string $alias The alias to use
boolean $columnNames Whether or not to use column names instead of field names

Return Value

string $orderByStatement

isRefClass()

string __toString()

__toString

Return Value

string

Doctrine_Table getAssociationFactory()

Return Value

Doctrine_Table

getAssociationTable()

final getLocalRefColumnName()

getLocalRefColumnName returns the column name of the local reference column

final getLocalRefFieldName()

getLocalRefFieldName returns the field name of the local reference column

final getForeignRefColumnName()

getForeignRefColumnName returns the column name of the foreign reference column

final getForeignRefFieldName()

getForeignRefFieldName returns the field name of the foreign reference column