/**
  * Returns the static model of the specified AR class.
  * @param string $className
  * @return News the static model class
  */
 public static function model($className = __CLASS__)
 {
     return parent::model($className);
 }
示例#2
0
 /**
  * Добавляем новый комментарий:
  *
  * @return null
  **/
 public function newComment()
 {
     if (($module = Yii::app()->getModule('comment')) && $module->email) {
         /**
          * Объявляем новое событие
          * и заполняем нужными данными:
          **/
         $event = new NewCommentEvent($this);
         $event->module = $module;
         $event->comment = $this;
         $event->commentOwner = yupe\models\YModel::model($this->model)->findByPk($this->model_id);
         $this->onNewComment($event);
         return $event->isValid;
     }
     return true;
 }