protected function _entityConditions()
{
if (!$this->_entity || !($model = $this->_config['model'])) {
return array();
}
$key = $model::key($this->_entity->data());
if (!$key && $this->type() !== 'create') {
throw new ConfigException('No matching primary key found.');
}
if (is_array($key)) {
return $key;
}
$key = $model::meta('key');
$val = $this->_entity->{$key};
return $val ? array($key => $val) : array();
}