This commit is contained in:
parent
ab76c18fd7
commit
da1a6e38a9
@ -1454,26 +1454,6 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
|
|||||||
|
|
||||||
return $this;
|
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
|
* used to delete node from tree - MUST BE USE TO DELETE RECORD IF TABLE ACTS AS TREE
|
||||||
*
|
*
|
||||||
|
@ -96,7 +96,8 @@ abstract class Doctrine_Record_Abstract extends Doctrine_Access
|
|||||||
$this->_table->setOption('inheritanceMap', $map);
|
$this->_table->setOption('inheritanceMap', $map);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setSubclasses($map){
|
public function setSubclasses($map)
|
||||||
|
{
|
||||||
if (isset($map[get_class($this)])){
|
if (isset($map[get_class($this)])){
|
||||||
$this->_table->setOption('inheritanceMap', $map[get_class($this)]);
|
$this->_table->setOption('inheritanceMap', $map[get_class($this)]);
|
||||||
return;
|
return;
|
||||||
@ -234,4 +235,23 @@ abstract class Doctrine_Record_Abstract extends Doctrine_Access
|
|||||||
$this->hasColumn($name, $options['type'], $options['length'], $options);
|
$this->hasColumn($name, $options['type'], $options['length'], $options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user