hasConfiguration() public method

Checks if the configuration of this node type contains a setting for the given $configurationPath
public hasConfiguration ( string $configurationPath ) : boolean
$configurationPath string The name of the configuration option to verify
return boolean
 /**
  * @test
  */
 public function hasConfigurationReturnsFalseIfSpecifiedConfigurationPathDoesNotExist()
 {
     $nodeType = new NodeType('Neos.ContentRepository:Base', array(), array());
     $this->assertFalse($nodeType->hasConfiguration('some.nonExisting.path'));
 }
示例#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 '';
 }