Пример #1
0
 /**
  * Verify course
  *
  * @param  string		action (optional)
  * @return bool			true on sucess
  */
 public function verify($action = NULL)
 {
     // If action is 'add', make sure that course id/alias is unique
     if ($action == 'add') {
         $warehouse = new Warehouse();
         $courseIdExists = $warehouse->getCourseByAlias($this->getCourseId());
         if ($courseIdExists) {
             throw new \Exception(Lang::txt('Course with this alias already exists.'));
         }
     }
     parent::verify($action);
 }