예제 #1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getUser()
 {
     return $this->hasOne(User::className(), ['id' => 'user_id']);
 }
예제 #2
0
 public function getUsers()
 {
     return $this->hasMany(User::className(), ['id' => 'user_id'])->via('userGroups');
 }
예제 #3
0
 public function rules()
 {
     return [['email', 'filter', 'filter' => 'trim'], ['email', 'required'], ['email', 'email'], ['email', 'unique', 'targetClass' => User::className()], ['password', 'required'], ['password', 'string']];
 }