Neos\Flow\Security\Context::canBeInitialized PHP Method

canBeInitialized() public method

To be able to initialize, there needs to be an ActionRequest available, usually that is provided by the MVC router.
public canBeInitialized ( ) : boolean
return boolean
    public function canBeInitialized()
    {
        if ($this->request === null) {
            return false;
        }
        return true;
    }

Usage Example

 /**
  * Try to set the current account identifier emitting the events, if possible
  *
  * @return void
  */
 protected function initializeAccountIdentifier()
 {
     if ($this->securityContext->canBeInitialized()) {
         $account = $this->securityContext->getAccount();
         if ($account !== null) {
             $this->eventEmittingService->setCurrentAccountIdentifier($account->getAccountIdentifier());
         }
     }
 }
All Usage Examples Of Neos\Flow\Security\Context::canBeInitialized