/**
  * Registers hook(s)
  *
  * @return boolean
  */
 protected function _installHook()
 {
     $hook = new Hook();
     $hook->name = self::HOOK_ADD_URLS;
     $hook->title = 'GSitemap Append URLs';
     $hook->description = 'This hook allows a module to add URLs to a generated sitemap';
     $hook->position = true;
     return $hook->save();
 }
 public function createHook($hookName, $title = null, $description = null, $live_edit = 0)
 {
     if (Db::getInstance()->getValue('
         SELECT count(`id_hook`)
         FROM `' . _DB_PREFIX_ . 'hook`
         WHERE `name` = \'' . pSQL($hookName) . '\'') == '1') {
         return true;
     }
     if (is_null($description)) {
         $description = ucfirst($hookName);
     }
     if (is_null($title)) {
         $title = ucfirst($hookName);
     }
     $new_hook = new Hook();
     $new_hook->title = $title;
     $new_hook->description = $description;
     $new_hook->live_edit = $live_edit;
     $new_hook->name = $hookName;
     $new_hook->save();
     return true;
 }