Backend\Modules\Search\Engine\Model::existsSynonymById PHP 메소드

existsSynonymById() 공개 정적인 메소드

Check if a synonym exists
public static existsSynonymById ( integer $id ) : boolean
$id integer The id of the item we're looking for.
리턴 boolean
    public static function existsSynonymById($id)
    {
        return (bool) BackendModel::getContainer()->get('database')->getVar('SELECT 1
             FROM search_synonyms
             WHERE id = ?
             LIMIT 1', array((int) $id));
    }

Usage Example

예제 #1
0
 /**
  * Execute the action
  */
 public function execute()
 {
     // get parameters
     $this->id = $this->getParameter('id', 'int');
     // does the item exists
     if ($this->id !== null && BackendSearchModel::existsSynonymById($this->id)) {
         parent::execute();
         $this->getData();
         $this->loadForm();
         $this->validateForm();
         $this->parse();
         $this->display();
     } else {
         $this->redirect(BackendModel::createURLForAction('Index') . '&error=non-existing');
     }
 }
All Usage Examples Of Backend\Modules\Search\Engine\Model::existsSynonymById