Neos\Flow\ObjectManagement\ObjectManagerInterface::get PHP Метод

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

Important: If possible, instances of Prototype objects should always be created with the new keyword and Singleton objects should rather be injected by some type of Dependency Injection.
public get ( string $objectName ) : object
$objectName string The name of the object to return an instance of
Результат object The object instance
    public function get($objectName);

Usage Example

Пример #1
0
 /**
  * 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(\Neos\Flow\Configuration\Source\YamlSource::class);
     $routesConfiguration = $configurationSource->load($this->packageManager->getPackage('Neos.Setup')->getConfigurationPath() . ConfigurationManager::CONFIGURATION_TYPE_ROUTES);
     $this->router->setRoutesConfiguration($routesConfiguration);
     $componentContext->setParameter(\Neos\Flow\Mvc\Routing\RoutingComponent::class, 'skipRouterInitialization', true);
 }
All Usage Examples Of Neos\Flow\ObjectManagement\ObjectManagerInterface::get