1
0
mirror of synced 2025-01-29 19:41:45 +03:00

Fixed cleanData method

This commit is contained in:
zYne 2006-08-25 17:13:21 +00:00
parent 37b3ad1434
commit 46f2cbe426

View File

@ -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
*