Exemple #1
0
 public function findByOauthId($provider, $uid)
 {
     $found = $this->userRepository->findOne([MapAlias::CLASS_KEY => $this->userClassAlias, 'cred' => [MapAlias::CLASS_KEY => 'oauth', 'uid' => $uid, 'provider' => $provider]]);
     if (is_null($found)) {
         throw new UsernameNotFoundException("We don't know [{$provider}, {$uid}]");
     }
     return $found;
 }
Exemple #2
0
 /**
  * Get the unique entity in database (or create it)
  *
  * @return ParameterBag
  */
 protected function getUniqueInstance()
 {
     $singleton = $this->repo->findOne(['-class' => 'config']);
     if (is_null($singleton)) {
         $singleton = new ParameterBag($this->defaultParam);
     }
     return $singleton;
 }