Ejemplo n.º 1
0
 public function afterFind()
 {
     $start = strpos($this->data, '\\rules\\') + 7;
     $end = strpos($this->data, '"', $start) - $start;
     $this->data = substr($this->data, $start, $end);
     return parent::afterFind();
 }
Ejemplo n.º 2
0
 public function afterFind()
 {
     if ($this->data) {
         $this->data = unserialize($this->data);
     }
     return parent::afterFind();
 }
Ejemplo n.º 3
0
 /**
  * @param bool $insert
  * @param array $changedAttributes
  */
 public function afterSave($insert, $changedAttributes)
 {
     try {
         $auth = Yii::$app->authManager;
         $auth->revokeAll($this->id);
         $auth->assign($auth->getRole($this->role), $this->id);
     } catch (Exception $e) {
         Yii::warning($e->getCode() . ' - ' . $e->getMessage(), 'auth assign');
     }
     return parent::afterSave($insert, $changedAttributes);
 }