コード例 #1
0
ファイル: UserRepository.php プロジェクト: HOFB/HOFB
 /**
  * @param string $hash
  * @return UserModel
  */
 public function getByHash($hash)
 {
     if ($hash instanceof UserModel) {
         return $hash;
     }
     return parent::getByHash($hash);
 }
コード例 #2
0
ファイル: QueryFilter.php プロジェクト: HOFB/HOFB
 /**
  * @param            $key
  * @param            $value
  * @param Repository $transform
  * @return \stdClass
  */
 protected function transformByRepository($key, $value, EloquentRepository $transform)
 {
     try {
         $value = $transform->getByHash($value);
         $this->keys[$key] = $value;
     } catch (NotFoundModelException $e) {
         throw new BadRequestHttpException("{$value} not found.");
     }
     return $value;
 }