1
0
mirror of synced 2025-03-04 20:03:21 +03:00
This commit is contained in:
zYne 2007-07-23 23:10:50 +00:00
parent d0d2067942
commit 23025b5872

View File

@ -1452,6 +1452,26 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
return $this;
}
/**
* check
* adds a check constraint
*
* @param mixed $constraint either a SQL constraint portion or an array of CHECK constraints
* @param string $name optional constraint name
* @return Doctrine_Record this object
*/
public function check($constraint, $name = null)
{
if (is_array($constraint)) {
foreach ($constraint as $name => $def) {
$this->_table->addCheckConstraint($def, $name);
}
} else {
$this->_table->addCheckConstraint($constraint, $name);
}
return $this;
}
/**
* used to delete node from tree - MUST BE USE TO DELETE RECORD IF TABLE ACTS AS TREE
*