G
G
Greg Popov2016-04-24 11:37:45
Yii
Greg Popov, 2016-04-24 11:37:45

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;

But what is confusing is that any findSomething in the UserModel looks like this:
/**
     * @inheritdoc
     */
    public static function findIdentity($id)
    {
        return static::findOne(['id' => $id, 'status' => self::STATUS_ADDED]);
    }

The question is: where to read about how to use it correctly, and how to search by self::STATUS_ADDED || self::STATUS_ACTIVATED
self::STATUS_ACTIVATED - this is an account activated from email

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nepster-web, 2016-04-24
@nepster-web

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 question

Ask a Question

731 491 924 answers to any question