public function set($property, $value = null)
{
if (!is_array($property)) {
$property = array($property => $value);
}
foreach ($property as $field => $val) {
if (method_exists($this, $method = 'set_' . $field)) {
$property[$field] = $this->{$method}($val);
$value = null;
} elseif (method_exists($this, $field)) {
$this->relationships[$field] = $val;
}
}
$result = $this->orm->set($property, $value);
return $result;
}