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

@@ -4,6 +4,7 @@ namespace common\models;
use common\components\Redis\Set;
use Yii;
use yii\base\NotSupportedException;
use yii\behaviors\TimestampBehavior;
use yii\db\ActiveQuery;
use yii\db\ActiveRecord;
@@ -14,6 +15,7 @@ use yii\db\ActiveRecord;
* @property string|null $owner_id
* @property string $client_id
* @property string $client_redirect_uri
* @property integer $created_at
*
* Отношения
* @property OauthClient $client
@@ -26,6 +28,15 @@ class OauthSession extends ActiveRecord {
return '{{%oauth_sessions}}';
}
public function behaviors() {
return [
[
'class' => TimestampBehavior::class,
'updatedAtAttribute' => false,
],
];
}
public function getClient(): ActiveQuery {
return $this->hasOne(OauthClient::class, ['id' => 'client_id']);
}