Neos\Flow\Aop\Pointcut\RuntimeExpressionEvaluator::injectObjectManager PHP Метод

injectObjectManager() публичный Метод

This object is created very early and is part of the blacklisted "Neos\Flow\Aop" namespace so we can't rely on AOP for the property injection.
public injectObjectManager ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : void
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
Результат void
    public function injectObjectManager(ObjectManagerInterface $objectManager)
    {
        if ($this->objectManager === null) {
            $this->objectManager = $objectManager;
            /** @var CacheManager $cacheManager */
            $cacheManager = $this->objectManager->get(CacheManager::class);
            $this->runtimeExpressionsCache = $cacheManager->getCache('Flow_Aop_RuntimeExpressions');
            $this->runtimeExpressions = $this->runtimeExpressionsCache->requireOnce('Flow_Aop_RuntimeExpressions');
        }
    }

Usage Example

 /**
  * @return void
  */
 protected function initialize()
 {
     if ($this->runtimeExpressionEvaluator !== null) {
         return;
     }
     /** @var CacheManager $cacheManager */
     $cacheManager = $this->objectManager->get(CacheManager::class);
     $this->runtimeExpressionEvaluator = $this->objectManager->get(RuntimeExpressionEvaluator::class);
     $this->runtimeExpressionEvaluator->injectObjectManager($this->objectManager);
     if (static::$methodPermissions !== null) {
         return;
     }
     static::$methodPermissions = $cacheManager->getCache('Flow_Security_Authorization_Privilege_Method')->get('methodPermission');
 }