Fixed cleanData method
This commit is contained in:
parent
37b3ad1434
commit
46f2cbe426
@ -270,7 +270,9 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
|
||||
case "object":
|
||||
|
||||
if($tmp[$name] !== self::$null) {
|
||||
$value = unserialize($tmp[$name]);
|
||||
if( ! is_array($tmp[$name] && ! is_object($tmp[$name]))
|
||||
$value = unserialize($tmp[$name]);
|
||||
|
||||
if($value === false)
|
||||
throw new Doctrine_Exception("Unserialization of $name failed. ".var_dump($tmp[$name],true));
|
||||
|
||||
@ -1243,6 +1245,15 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
|
||||
final public function hasColumn($name, $type, $length = 20, $options = "") {
|
||||
$this->table->setColumn($name, $type, $length, $options);
|
||||
}
|
||||
/**
|
||||
* countRelated
|
||||
*/
|
||||
public function countRelated($name) {
|
||||
$rel = $this->table->getForeignKey($name);
|
||||
$componentName = $rel->getTable()->getTableName();
|
||||
|
||||
return $rel->getCountFor($this);
|
||||
}
|
||||
/**
|
||||
* merge
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user