/**
  * @inheritdoc
  */
 public function get($clientId, $clientSecret = null, $redirectUri = null, $grantType = null)
 {
     $client = Client::findByKey($clientId);
     if ($client === null) {
         throw new ClientNotFound();
     }
     return $this->createEntity($client);
 }
 /**
  * @inheritdoc
  */
 public function create($ownerType, $ownerId, $clientId, $clientRedirectUri = null)
 {
     $client = Client::findByKey($clientId);
     if ($client === null) {
         throw new ClientNotFound();
     }
     $session = new Session(['clientId' => $client->getKey(), 'ownerType' => $ownerType, 'ownerId' => $ownerId, 'clientRedirectUri' => $clientRedirectUri]);
     $session->setId(ShortId::create()->generate());
     $session->save();
     return $session->getKey();
 }