Commit 11baf619 by Qiang Xue

Fixed unsetting relation bug.

parent 4d538d6b
......@@ -251,7 +251,7 @@ class Component extends Object
}
}
}
throw new InvalidCallException('Unsetting an unknown or read-only property: ' . get_class($this) . '.' . $name);
throw new InvalidCallException('Unsetting an unknown or read-only property: ' . get_class($this) . '::' . $name);
}
/**
......
......@@ -303,12 +303,10 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
{
if ($this->hasAttribute($name)) {
unset($this->_attributes[$name]);
} elseif (array_key_exists($name, $this->_related)) {
unset($this->_related[$name]);
} else {
if (isset($this->_related[$name])) {
unset($this->_related[$name]);
} else {
parent::__unset($name);
}
parent::__unset($name);
}
}
......
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