コード例 #1
0
 public function handle(GetResponseEvent $event)
 {
     if (null !== $this->tokenStorage->getToken()) {
         return;
     }
     $this->tokenStorage->setToken(new AnonymousToken($this->key, NULLUser::getInstance(), []));
 }
コード例 #2
0
 public function add(QuestionSheet $sheet)
 {
     if (NULLUser::getInstance() === $sheet->getOwner()) {
         throw new \InvalidArgumentException("incorrect user");
     }
     $this->entityManager->persist($sheet);
     $this->entityManager->flush();
 }
コード例 #3
0
 protected function incorrectInput($object, $user)
 {
     return !$object instanceof QuestionSheet || $user === NULLUser::getInstance();
 }