예제 #1
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (empty($this->attributes)) {
         $this->attributes = [BaseActiveRecord::EVENT_BEFORE_INSERT => [$this->createdAtAttribute, $this->updatedAtAttribute], BaseActiveRecord::EVENT_BEFORE_UPDATE => $this->updatedAtAttribute];
     }
 }
예제 #2
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (empty($this->attributes)) {
         $this->attributes = [BaseActiveRecord::EVENT_BEFORE_VALIDATE => $this->slugAttribute];
     }
     if ($this->attribute === null && $this->value === null) {
         throw new BehaviorException('Either "attribute" or "value" property must be specified.');
     }
 }