12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
- namespace fphammerle\yii2\auth\clientcert\tests\models;
- class User extends \yii\db\ActiveRecord
- implements \yii\web\IdentityInterface
- {
- public static function tableName()
- {
- return 'user';
- }
- public static function findIdentity($id)
- {
- return static::findOne(['id' => $id]);
- }
- public static function findIdentityByAccessToken($token, $type = null)
- {
- throw new NotSupportedException();
- }
- public function getId()
- {
- return $this->primaryKey;
- }
- public function getAuthKey()
- {
- return sprintf('auth-key-%d', $this->id);
- }
- public function validateAuthKey($authKey)
- {
- return $this->getAuthKey() === $authKey;
- }
- }
|