public function changed($field = NULL)
{
if ($field === NULL) {
// Note that array_diff_assoc() can't be used here because it
// assumes that any two array values are the same... WTF!
$changed = $this->as_array();
foreach ($changed as $field => $value) {
if (!array_key_exists($field, $this->_changed)) {
unset($changed[$field]);
}
}
return $changed;
} else {
return array_key_exists($field, $this->_changed);
}
}