public function save()
{
if (is_numeric($this->page_id) && is_string($this->page_name)) {
$db = new Db();
$id = $db->quote($this->page_id);
$category_id = $db->quote($this->category_id);
$name = $db->quote($this->page_name);
$url = $db->quote($this->url);
$top_description = $db->quote($this->top_description);
$bottem_description = $db->quote($this->bottom_description);
$keyword = $db->quote($this->keyword);
$title = $db->quote($this->title);
$description = $db->quote($this->description);
$access_type = $db->quote($this->access_type);
$active = $db->quote($this->page_status);
$author = $db->quote(1);
$modified = $db->quote(1);
$query = "INSERT INTO " . $this->tableName() . " (page_id, category_id, name, url, top_description, bottem_description, \n Keyword, title, description, author, modified_by, access_type, active) \n VALUES({$id}, {$category_id}, {$name}, {$url}, {$top_description}, {$bottem_description}, {$keyword}, {$title}, {$description},\n {$author}, {$modified}, {$access_type}, {$active})\n ON DUPLICATE KEY UPDATE \n name= {$name}, category_id={$category_id}, url={$url},top_description={$top_description}, bottem_description={$bottem_description}, \n Keyword={$keyword}, title={$title}, description={$description}, author={$author}, modified_by={$modified}, \n active={$active}, access_type={$access_type}";
if ($db->query($query)) {
return true;
} else {
Error::set($db->error());
}
}
return false;
}