getConfiguration() public method

Returns the configuration option with the specified $configurationPath or NULL if it does not exist
public getConfiguration ( string $configurationPath ) : mixed
$configurationPath string The name of the configuration option to retrieve
return mixed
 /**
  * @test
  */
 public function getConfigurationReturnsNullIfTheSpecifiedPathDoesNotExist()
 {
     $nodeType = new NodeType('Neos.ContentRepository:Base', array(), array());
     $this->assertNull($nodeType->getConfiguration('some.nonExisting.path'));
 }
Beispiel #2
0
 /**
  * Generate a TypoScript prototype definition for a given node type
  *
  * A prototype will be rendererd with the generator-class defined in the
  * nodeType-configuration 'fusion.prototypeGenerator'
  *
  * @param NodeType $nodeType
  * @return string
  * @throws \Neos\Neos\Domain\Exception
  */
 protected function generateTypoScriptForNodeType(NodeType $nodeType)
 {
     if ($nodeType->hasConfiguration('options.fusion.prototypeGenerator') && $nodeType->getConfiguration('options.fusion.prototypeGenerator') !== null) {
         $generatorClassName = $nodeType->getConfiguration('options.fusion.prototypeGenerator');
         if (!class_exists($generatorClassName)) {
             throw new \Neos\Neos\Domain\Exception('Fusion prototype-generator Class ' . $generatorClassName . ' does not exist');
         }
         $generator = $this->objectManager->get($generatorClassName);
         if (!$generator instanceof DefaultPrototypeGeneratorInterface) {
             throw new \Neos\Neos\Domain\Exception('Fusion prototype-generator Class ' . $generatorClassName . ' does not implement interface ' . DefaultPrototypeGeneratorInterface::class);
         }
         return $generator->generate($nodeType);
     }
     return '';
 }