public function updateSEOKeyword($keyword)
{
if (!$this->isNewRecord) {
$alias = $this->getUrlAlias();
// if keyword is empty delete url alias
if (empty($keyword) || is_null($keyword)) {
if (!is_null($alias)) {
return $alias->delete();
}
return false;
} else {
if (is_null($alias)) {
$alias = new UrlAlias();
$alias->query = "manufacturer_id={$this->manufacturer_id}";
}
$alias->keyword = $keyword;
return $alias->save();
}
} else {
throw new CException(Yii::t('errors', 'Tried to update SEO Keyword for an object that doesn\'t exists yet.'));
}
}