Implementation of the backend for the OAuth2 clients management

This commit is contained in:
ErickSkrauch
2018-02-28 01:27:35 +03:00
parent ddec87e3a9
commit 673429e577
55 changed files with 1810 additions and 65 deletions

View File

@@ -0,0 +1,34 @@
<?php
declare(strict_types=1);
namespace common\models;
use yii\db\ActiveQuery;
use yii\db\Command;
/**
* @see OauthClient
*/
class OauthClientQuery extends ActiveQuery {
private $showDeleted = false;
public function includeDeleted(): self {
$this->showDeleted = true;
return $this;
}
public function onlyDeleted(): self {
$this->showDeleted = true;
return $this->andWhere(['is_deleted' => true]);
}
public function createCommand($db = null): Command {
if ($this->showDeleted === false) {
$this->andWhere(['is_deleted' => false]);
}
return parent::createCommand($db);
}
}