Commit 62f72a70 authored by zYne's avatar zYne

--no commit message

--no commit message
parent 0bf5bf83
...@@ -67,6 +67,7 @@ abstract class Doctrine_Relation ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment