| 1 | <?php |
||
| 24 | abstract class AbstractProviderIdentity extends ActiveRecord implements ProviderIdentityInterface |
||
| 25 | { |
||
| 26 | use Ember; |
||
| 27 | /** |
||
| 28 | * @var \craft\elements\User |
||
| 29 | */ |
||
| 30 | private $user; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @return \craft\elements\User|null |
||
| 34 | */ |
||
| 35 | public function getUser() |
||
| 36 | { |
||
| 37 | if (! $this->userId) { |
||
| 38 | return null; |
||
| 39 | } |
||
| 40 | if (! $this->user) { |
||
| 41 | $this->user = \Craft::$app->getUsers()->getUserById( |
||
| 42 | $this->userId |
||
| 43 | ); |
||
| 44 | } |
||
| 45 | return $this->user; |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @return ActiveQuery |
||
| 50 | */ |
||
| 51 | abstract public function getProvider(); |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @inheritdoc |
||
| 55 | */ |
||
| 56 | public function rules() |
||
| 80 | } |
||
| 81 |