255], [['comment'], 'string'], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'email' => 'Email', 'phone' => 'Phone', 'profile_id' => 'Profile ID', 'user_id' => 'User ID', 'created_at' => 'Created At', 'comment' => 'Комментарий', ]; } /** * @return \yii\db\ActiveQuery */ public function getProfile() { return $this->hasOne(UserCard::class, ['id' => 'profile_id']); } /** * @return \yii\db\ActiveQuery */ public function getUser() { return $this->hasOne(User::class, ['id' => 'user_id']); } /** * @return bool|int|string|null */ public static function getNewCount() { return self::find()->where(['new' => 1])->count(); } }