Example #1
0
 public function afterFind()
 {
     parent::afterFind();
     $parent = (new \yii\db\Query())->select('parent')->where(['child' => $this->name])->from(\Yii::$app->authManager->itemChildTable)->scalar();
     if ($parent) {
         $this->parent = $parent;
     }
 }
Example #2
0
 public function init()
 {
     parent::init();
     if (!$this->module) {
         $this->module = Yii::$app->getModule('users');
     }
 }