Possibility to call all the api endpoints with id or username or email
This commit is contained in:
@ -15,6 +15,18 @@ use yii\db\ActiveQuery;
|
||||
|
||||
class UserQuery extends ActiveQuery
|
||||
{
|
||||
/**
|
||||
* @param $idOrUsernameOrEmail
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function whereIdOrUsernameOrEmail($idOrUsernameOrEmail)
|
||||
{
|
||||
return filter_var($idOrUsernameOrEmail, FILTER_VALIDATE_INT)
|
||||
? $this->whereId($idOrUsernameOrEmail)
|
||||
: $this->whereUsernameOrEmail($idOrUsernameOrEmail);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $usernameOrEmail
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user