'10'], [['username', 'name', 'surname', 'phone', 'email', 'password_reset_token'], 'string', 'max' => 255], [['gender', 'auth_key'], 'string', 'max' => 32], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'username' => 'Username', 'name' => 'Name', 'surname' => 'Surname', 'phone' => 'Phone', 'date_time' => 'Date Time', 'gender' => 'Gender', 'birth_day' => 'Birth Day', 'birth_month' => 'Birth Month', 'birth_year' => 'Birth Year', 'body' => 'Body', 'group_id' => 'Group ID', 'email' => 'Email', 'auth_key' => 'Auth Key', 'password_reset_token' => 'Password Reset Token', 'status' => 'Status', 'created_at' => 'Created At', 'updated_at' => 'Updated At', ]; } /** * @return \yii\db\ActiveQuery */ public function getShares() { return $this->hasMany(Share::className(), ['user_id' => 'id']); } /** * Finds user by email * * @param string $email * @return static|null */ public static function findByEmail($email) { return static::findOne(['email' => $email, 'status' => self::STATUS_ACTIVE]); } public function getName(){ return $this->username. ' '.$this->surname; } }