|
Doctrine 1.2.4
|
Inherits ArrayAccess.
Inherited by Doctrine_Relation_Association, Doctrine_Relation_ForeignKey, and Doctrine_Relation_LocalKey.
Public Member Functions | |
| __construct (array $definition) | |
| __toString () | |
| fetchRelatedFor (Doctrine_Record $record) | |
| getAlias () | |
| getClass () | |
| getForeign () | |
| getForeignColumnName () | |
| getForeignFieldName () | |
| getForeignKeyName () | |
| getLocal () | |
| getLocalColumnName () | |
| getLocalFieldName () | |
| getOrderBy ($alias=null, $columnNames=false) | |
| getOrderByStatement ($alias=null, $columnNames=false) | |
| getRelationDql ($count) | |
| getTable () | |
| getType () | |
| hasConstraint () | |
| isCascadeDelete () | |
| isOneToOne () | |
| toArray () | |
Data Fields | |
| const | MANY = 1 |
| const | ONE = 0 |
Definition at line 34 of file Relation.php.
| array $definition see Doctrine_Relation::__construct | ( | array | $definition | ) |
constructor
| 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
Definition at line 128 of file Relation.php.
| Doctrine_Relation::__toString | ( | ) |
__toString
Definition at line 444 of file Relation.php.
|
abstract |
fetchRelatedFor
fetches a component related to given record
| Doctrine_Record | $record |
|
final |
getAlias returns the relation alias
Definition at line 214 of file Relation.php.
|
final |
getClass returns the name of the related class
Definition at line 261 of file Relation.php.
|
final |
getForeign returns the name of the foreignkey column where the localkey column is pointing at
Definition at line 304 of file Relation.php.
|
final |
getForeignColumnName returns the column name of the foreign column
Definition at line 324 of file Relation.php.
|
final |
getLocalFieldName returns the field name of the foreign column
Definition at line 313 of file Relation.php.
| Doctrine_Relation::getForeignKeyName | ( | ) |
Get the name of the foreign key for this relationship
Definition at line 373 of file Relation.php.
|
final |
getLocal returns the name of the local column
Definition at line 272 of file Relation.php.
|
final |
getLocalColumnName returns the column name of the local column
Definition at line 292 of file Relation.php.
|
final |
getLocalFieldName returns the field name of the local column
Definition at line 281 of file Relation.php.
| Doctrine_Relation::getOrderBy | ( | $alias = null, |
|
$columnNames = false |
|||
| ) |
Get the relationship orderby SQL/DQL
| string | $alias | The alias to use |
| boolean | $columnNames | Whether or not to use column names instead of field names |
Definition at line 388 of file Relation.php.
| Doctrine_Relation::getOrderByStatement | ( | $alias = null, |
|
$columnNames = false |
|||
| ) |
Get the relationship orderby statement
| string | $alias | The alias to use |
| boolean | $columnNames | Whether or not to use column names instead of field names |
Definition at line 406 of file Relation.php.
| Doctrine_Relation::getRelationDql | ( | $count | ) |
getRelationDql
| integer | $count |
Definition at line 346 of file Relation.php.
|
final |
getTable returns the foreign table object
Definition at line 248 of file Relation.php.
|
final |
getType returns the relation type, either 0 or 1
Definition at line 226 of file Relation.php.
| Doctrine_Relation::hasConstraint | ( | ) |
hasConstraint whether or not this relation has an explicit constraint
Definition at line 150 of file Relation.php.
| Doctrine_Relation::isCascadeDelete | ( | ) |
Checks whether this relation cascades deletions to the related objects on the application level.
Definition at line 237 of file Relation.php.
|
final |
isOneToOne returns whether or not this relation is a one-to-one relation
Definition at line 335 of file Relation.php.
| Doctrine_Relation::toArray | ( | ) |
| const Doctrine_Relation::MANY = 1 |
constant for MANY_TO_MANY and ONE_TO_MANY relationships
Definition at line 48 of file Relation.php.
| const Doctrine_Relation::ONE = 0 |
RELATION CONSTANTS constant for ONE_TO_ONE and MANY_TO_ONE relationships
Definition at line 43 of file Relation.php.