255, ], [ [ 'user_id' ], 'exist', 'skipOnError' => true, 'targetClass' => User::className(), 'targetAttribute' => [ 'user_id' => 'id' ], ], [ [ 'phone' ], 'match', 'pattern' => '/\+38\s\(\d{3}\)\s\d{3}-\d{2}-\d{2}/', ], [ ['email'], 'email', ] ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'user_id' => 'User ID', 'name' => 'Ім\'я', 'surname' => 'Прізвище', 'patronymic' => 'По батькові', 'phone' => 'Телефон', 'email' => 'Email', 'inn' => 'ІНН', ]; } /** * @return \yii\db\ActiveQuery */ public function getUser() { return $this->hasOne(User::className(), [ 'id' => 'user_id' ]); } }