当前位置: 首页>>代码示例>>PHP>>正文


PHP ObjectManagerInterface::get方法代码示例

本文整理汇总了PHP中TYPO3\Flow\Object\ObjectManagerInterface::get方法的典型用法代码示例。如果您正苦于以下问题:PHP ObjectManagerInterface::get方法的具体用法?PHP ObjectManagerInterface::get怎么用?PHP ObjectManagerInterface::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TYPO3\Flow\Object\ObjectManagerInterface的用法示例。


在下文中一共展示了ObjectManagerInterface::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: queue

 /**
  * @param Message $message
  * @return void
  */
 public function queue(Message $message)
 {
     /** @var EventHandlerInterface $handler */
     $handler = $this->objectManager->get($message->getRecipient());
     $event = $this->arraySerializer->unserialize($message->getPayload());
     $handler->handle($event);
 }
开发者ID:flow2lab,项目名称:eventsourcing,代码行数:11,代码来源:ImmediateQueue.php

示例2: __construct

 /**
  * Initializes the context
  *
  * @param array $parameters Context parameters (configured through behat.yml)
  */
 public function __construct(array $parameters)
 {
     $this->useContext('flow', new \Flowpack\Behat\Tests\Behat\FlowContext($parameters));
     $this->flowContext = $this->getSubcontext('flow');
     $this->objectManager = $this->flowContext->getObjectManager();
     $this->accountRepository = $this->objectManager->get('TYPO3\\Flow\\Security\\AccountRepository');
 }
开发者ID:yashodhank,项目名称:panel,代码行数:12,代码来源:FeatureContext.php

示例3: getNodeGeneratorImplementationClassByNodeType

 /**
  * @param NodeType $nodeType
  * @return NodeGeneratorImplementationInterface
  * @throws \TYPO3\Flow\Exception
  */
 protected function getNodeGeneratorImplementationClassByNodeType(NodeType $nodeType)
 {
     if (!isset($this->generators[(string) $nodeType]['class'])) {
         throw new Exception(sprintf('Unknown generator for the current Node Type (%s)', (string) $nodeType, 1391771111));
     }
     return $this->objectManager->get($this->generators[(string) $nodeType]['class']);
 }
开发者ID:kdambekalns,项目名称:Flowpack.NodeGenerator,代码行数:12,代码来源:NodesGenerator.php

示例4: initializeObject

 /**
  * Adds all validators that extend the AssetValidatorInterface.
  *
  * @return void
  */
 protected function initializeObject()
 {
     $assetValidatorImplementationClassNames = $this->reflectionService->getAllImplementationClassNamesForInterface('TYPO3\\Media\\Domain\\Validator\\AssetValidatorInterface');
     foreach ($assetValidatorImplementationClassNames as $assetValidatorImplementationClassName) {
         $this->addValidator($this->objectManager->get($assetValidatorImplementationClassName));
     }
 }
开发者ID:robertlemke,项目名称:neos-development-collection,代码行数:12,代码来源:AssetValidator.php

示例5: setPattern

 /**
  * Sets the pattern (match) configuration
  *
  * @param object $patternConfiguration The pattern (match) configuration
  * @return void
  */
 public function setPattern($patternConfiguration)
 {
     $this->patternConfiguration = $patternConfiguration;
     if (isset($patternConfiguration['resolverType'])) {
         $this->publicKeyResolver = $this->objectManager->get($patternConfiguration['resolverType']);
     }
 }
开发者ID:anihy,项目名称:Flowpack.SingleSignOn.Client,代码行数:13,代码来源:SignedRequestPattern.php

示例6: create

 /**
  * @param array $chainConfiguration
  * @return ComponentChain
  * @throws Exception
  */
 public function create(array $chainConfiguration)
 {
     if (empty($chainConfiguration)) {
         return null;
     }
     $arraySorter = new PositionalArraySorter($chainConfiguration);
     $sortedChainConfiguration = $arraySorter->toArray();
     $chainComponents = array();
     foreach ($sortedChainConfiguration as $componentName => $configuration) {
         $componentOptions = isset($configuration['componentOptions']) ? $configuration['componentOptions'] : array();
         if (isset($configuration['chain'])) {
             $component = $this->create($configuration['chain']);
         } else {
             if (!isset($configuration['component'])) {
                 throw new Exception(sprintf('Component chain could not be created because no component class name is configured for component "%s"', $componentName), 1401718283);
             }
             $component = $this->objectManager->get($configuration['component'], $componentOptions);
             if (!$component instanceof ComponentInterface) {
                 throw new Exception(sprintf('Component chain could not be created because the class "%s" does not implement the ComponentInterface, in component "%s" does not implement', $configuration['component'], $componentName), 1401718283);
             }
         }
         $chainComponents[] = $component;
     }
     return new ComponentChain(array('components' => $chainComponents));
 }
开发者ID:kszyma,项目名称:flow-development-collection,代码行数:30,代码来源:ComponentChainFactory.php

示例7: handle

 /**
  * Set the routes configuration for the Neos setup and configures the routing component
  * to skip initialisation, which would overwrite the specific settings again.
  *
  * @param ComponentContext $componentContext
  * @return void
  */
 public function handle(ComponentContext $componentContext)
 {
     $configurationSource = $this->objectManager->get('TYPO3\\Flow\\Configuration\\Source\\YamlSource');
     $routesConfiguration = $configurationSource->load($this->packageManager->getPackage('TYPO3.Setup')->getConfigurationPath() . ConfigurationManager::CONFIGURATION_TYPE_ROUTES);
     $this->router->setRoutesConfiguration($routesConfiguration);
     $componentContext->setParameter('TYPO3\\Flow\\Mvc\\Routing\\RoutingComponent', 'skipRouterInitialization', TRUE);
 }
开发者ID:kdambekalns,项目名称:setup,代码行数:14,代码来源:ConfigureRoutingComponent.php

示例8: initializeObject

 /**
  * Adds all validators that extend the AssetValidatorInterface.
  *
  * @return void
  */
 protected function initializeObject()
 {
     $assetValidatorImplementationClassNames = $this->reflectionService->getAllImplementationClassNamesForInterface(AssetValidatorInterface::class);
     foreach ($assetValidatorImplementationClassNames as $assetValidatorImplementationClassName) {
         $this->addValidator($this->objectManager->get($assetValidatorImplementationClassName));
     }
 }
开发者ID:johannessteu,项目名称:neos-development-collection,代码行数:12,代码来源:AssetValidator.php

示例9: convertFrom

 /**
  * @param mixed $source
  * @param string $targetType
  * @param array $convertedChildProperties
  * @param PropertyMappingConfigurationInterface|null $configuration
  * @return mixed|\Netlogix\JsonApiOrg\Schema\ResourceInterface|\TYPO3\Flow\Error\Error
  */
 public function convertFrom($source, $targetType, array $convertedChildProperties = array(), PropertyMappingConfigurationInterface $configuration = null)
 {
     if (is_string($source)) {
         $sourceArray = json_decode($source, true);
         $source = is_array($sourceArray) ? $sourceArray : ['id' => $source];
     }
     if (!array_key_exists('type', $source)) {
         $dummyPayload = $this->objectManager->get($targetType);
         $typeIdentifier = $dummyPayload->getType();
         $source['type'] = $this->exposableTypeMap->getType($typeIdentifier);
     }
     if (array_key_exists('id', $source)) {
         $arguments = $source['id'];
     } else {
         $arguments = [];
     }
     $payload = $this->propertyMapper->convert($arguments, $this->exposableTypeMap->getClassName($source['type']));
     $resourceInformation = $this->resourceMapper->findResourceInformation($payload);
     $resource = $resourceInformation->getResource($payload);
     if (isset($source['attributes'])) {
         $attributes = $resource->getAttributes();
         foreach ($source['attributes'] as $fieldName => $value) {
             $attributes[$fieldName] = $value;
         }
     }
     if (isset($source['relationships'])) {
         $relationships = $resource->getRelationships();
         foreach ($source['relationships'] as $fieldName => $value) {
             $relationships[$fieldName] = $value;
         }
     }
     return $resource;
 }
开发者ID:netlogix,项目名称:jsonapiorg,代码行数:40,代码来源:ResourceConverter.php

示例10: __construct

 /**
  * Initializes the context
  *
  * @param array $parameters Context parameters (configured through behat.yml)
  */
 public function __construct(array $parameters)
 {
     $this->useContext('flow', new \Flowpack\Behat\Tests\Behat\FlowContext($parameters));
     $this->objectManager = $this->getSubcontext('flow')->getObjectManager();
     $this->environment = $this->objectManager->get('TYPO3\\Flow\\Utility\\Environment');
     $this->nodeAuthorizationService = $this->objectManager->get('TYPO3\\TYPO3CR\\Service\\AuthorizationService');
 }
开发者ID:sandstorm,项目名称:contentcomments,代码行数:12,代码来源:FeatureContext.php

示例11: create

 /**
  * Mocks an entity as wished
  * 
  * @param  string  $fqcn             the fully qualified class name
  * @param  boolean $persist          if the entity should be directly persisted or not
  * @param  array   $customProperties the properties to set if wished
  * @return Object
  */
 public function create($fqcn, $persist = false, $customProperties = array())
 {
     $entityConfiguration = $this->entityConfiguration[$fqcn];
     $this->validateEntityConfiguration($fqcn, $entityConfiguration);
     // create from reflection class if constructor needs arguments
     if (!empty($entityConfiguration['constructorArguments'])) {
         $reflector = new \ReflectionClass($fqcn);
         $constructorArguments = $this->getValuesFromConfigurations($entityConfiguration['constructorArguments']);
         $entity = $reflector->newInstanceArgs($constructorArguments);
     } else {
         $entity = new $fqcn();
     }
     // set the properties
     $configuredProperties = $entityConfiguration['properties'] ?: array();
     $properties = array_merge($configuredProperties, $customProperties);
     foreach ($this->getValuesFromConfigurations($properties, $persist) as $propertyName => $propertyValue) {
         $propertyCouldBeSet = ObjectAccess::setProperty($entity, $propertyName, $propertyValue);
         if (!$propertyCouldBeSet) {
             throw new \Exception($fqcn . '::$' . $propertyName . ' could not be set to ' . print_r($propertyValue, true), 1416481470);
         }
     }
     // persist if wished
     if ($persist && is_string($entityConfiguration['repository'])) {
         $this->objectManager->get($entityConfiguration['repository'])->add($entity);
         // flush this entity here...
         $this->entityManager->flush($entity);
         // add to managed entities
         $identifier = $this->persistenceManager->getIdentifierByObject($entity);
         $this->managedEntities[$identifier] = $entity;
     }
     return $entity;
 }
开发者ID:econic,项目名称:testing,代码行数:40,代码来源:EntityFactory.php

示例12: getTokenEndpointForProvider

 /**
  * @param string $providerName The provider name as given in Settings.yaml
  * @throws \InvalidArgumentException
  * @return TokenEndpointInterface
  */
 public function getTokenEndpointForProvider($providerName)
 {
     $tokenEndpointClassName = $this->configurationManager->getConfiguration(ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, sprintf('TYPO3.Flow.security.authentication.providers.%s.providerOptions.tokenEndpointClassName', $providerName));
     if ($tokenEndpointClassName === NULL) {
         throw new \InvalidArgumentException(sprintf('In Settings.yaml, there was no "tokenEndpointClassName" option given for the provider "%s".', $providerName), 1383743372);
     }
     return $this->objectManager->get($tokenEndpointClassName);
 }
开发者ID:avency,项目名称:Flowpack.OAuth2.Client,代码行数:13,代码来源:Resolver.php

示例13: preToolbarRendering

 /**
  * TODO: Document this Method!
  */
 public function preToolbarRendering()
 {
     $dispatcher = $this->objectManager->get('TYPO3\\Flow\\SignalSlot\\Dispatcher');
     if (method_exists($dispatcher, 'getSignals')) {
         $classes = $this->objectManager->get('TYPO3\\Flow\\SignalSlot\\Dispatcher')->getSignals();
         $classes = $this->sanitize($classes);
         \Debug\Toolbar\Service\Collector::getModule('Signals')->getToolbar()->addText('Signals')->addBadge(count($classes))->getPopup()->addPartial('Signals', array('classes' => $classes))->getPanel()->addPartial('Signals', array('classes' => $classes));
     }
 }
开发者ID:radmiraal,项目名称:Debug.Toolbar,代码行数:12,代码来源:SignalDebugger.php

示例14: injectObjectManager

 /**
  * This object is created very early and is part of the blacklisted "TYPO3\Flow\Aop" namespace so we can't rely on AOP for the property injection.
  *
  * @param ObjectManagerInterface $objectManager
  * @return void
  */
 public function injectObjectManager(ObjectManagerInterface $objectManager)
 {
     if ($this->objectManager === null) {
         $this->objectManager = $objectManager;
         /** @var CacheManager $cacheManager */
         $cacheManager = $this->objectManager->get(\TYPO3\Flow\Cache\CacheManager::class);
         $this->runtimeExpressionsCache = $cacheManager->getCache('Flow_Aop_RuntimeExpressions');
         $this->runtimeExpressions = $this->runtimeExpressionsCache->requireOnce('Flow_Aop_RuntimeExpressions');
     }
 }
开发者ID:kaystrobach,项目名称:flow,代码行数:16,代码来源:RuntimeExpressionEvaluator.php

示例15: create

 /**
  * @param string $annotatedTransformer Either a full qualified class name or a shortened one which is seeked in the current package.
  *
  * @throws \Flowpack\ElasticSearch\Exception
  * @return \Flowpack\ElasticSearch\Indexer\Object\Transform\TransformerInterface
  */
 public function create($annotatedTransformer)
 {
     if (!class_exists($annotatedTransformer)) {
         $annotatedTransformer = 'Flowpack\\ElasticSearch\\Indexer\\Object\\Transform\\' . $annotatedTransformer . 'Transformer';
     }
     $transformer = $this->objectManager->get($annotatedTransformer);
     if (!$transformer instanceof \Flowpack\ElasticSearch\Indexer\Object\Transform\TransformerInterface) {
         throw new \Flowpack\ElasticSearch\Exception(sprintf('The transformer instance "%s" does not implement the TransformerInterface.', $annotatedTransformer), 1339598316);
     }
     return $transformer;
 }
开发者ID:johannessteu,项目名称:Flowpack.ElasticSearch,代码行数:17,代码来源:TransformerFactory.php


注:本文中的TYPO3\Flow\Object\ObjectManagerInterface::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。