Answer the question
In order to leave comments, you need to log in
Where can I read about STATUS_ADDED in Yii2?
Faced with misunderstanding of the moment about STATUD_ADDED in YII.
I want to do for user like this:
const STATUS_DELETED = 0;
const STATUS_ADDED = 20;
const STATUS_ACTIVATED = 30;
/**
* @inheritdoc
*/
public static function findIdentity($id)
{
return static::findOne(['id' => $id, 'status' => self::STATUS_ADDED]);
}
self::STATUS_ADDED || self::STATUS_ACTIVATED
Answer the question
In order to leave comments, you need to log in
Well, you need to learn PHP and for one yii2.
And for such things it is better to use custom kveri How to organize scope in Yii2?
But in general, it’s better to start by reading the yii2 docs, you will learn a lot of new things and many questions will disappear at once. Don't write code right away without skimming through the documentation.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question