Neos\Neos\EventLog\Domain\Service\EventEmittingService::setCurrentAccountIdentifier PHP Method

setCurrentAccountIdentifier() public method

Set the current account identifier
public setCurrentAccountIdentifier ( string $accountIdentifier ) : void
$accountIdentifier string
return void
    public function setCurrentAccountIdentifier($accountIdentifier)
    {
        $this->currentAccountIdentifier = $accountIdentifier;
    }

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());
         }
     }
 }