1
0
mirror of synced 2025-01-20 07:21:40 +03:00
This commit is contained in:
zYne 2007-06-14 20:37:11 +00:00
parent 0bf5bf839c
commit 62f72a7014

View File

@ -67,6 +67,7 @@ abstract class Doctrine_Relation
'onDelete' => false, 'onDelete' => false,
'onUpdate' => false, 'onUpdate' => false,
'deferred' => false, 'deferred' => false,
'deferrable' => false,
'constraint' => false, 'constraint' => false,
'equal' => false, 'equal' => false,
); );
@ -94,7 +95,7 @@ abstract class Doctrine_Relation
* *
* type the relation type, either Doctrine_Relation::ONE or Doctrine_Relation::MANY * type the relation type, either Doctrine_Relation::ONE or Doctrine_Relation::MANY
* *
* constraint boolean value, true if the relation needs referential integrity constraint * constraint boolean value, true if the relation has an explicit referential integrity constraint
* *
* The onDelete and onUpdate keys accept the following values: * The onDelete and onUpdate keys accept the following values:
* *
@ -131,10 +132,30 @@ abstract class Doctrine_Relation
$this->definition = $def; $this->definition = $def;
} }
/**
* hasConstraint
* whether or not this relation has an explicit constraint
*
* @return boolean
*/
public function hasConstraint()
{
return ($this->definition['constraint'] ||
($this->definition['onUpdate']) ||
($this->definition['onDelete']));
}
public function isDeferred()
{
return $this->definition['deferred'];
}
public function isDeferrable()
{
return $this->definition['deferrable'];
}
public function isEqual() public function isEqual()
{ {
return $this->definition['equal']; return $this->definition['equal'];
} }
/** /**
* toArray * toArray
@ -145,15 +166,6 @@ abstract class Doctrine_Relation
{ {
return $this->definition; return $this->definition;
} }
/**
* hasConstraint
*
* @return boolean
*/
public function hasConstraint()
{
return $this->definition['constraint'];
}
/** /**
* getAlias * getAlias
* returns the relation alias * returns the relation alias