Neos\ContentRepository\Domain\Model\NodeType::getProperties PHP 메소드

getProperties() 공개 메소드

Return the array with the defined properties. The key is the property name, the value the property configuration. There are no guarantees on how the property configuration looks like.
public getProperties ( ) : array
리턴 array
    public function getProperties()
    {
        $this->initialize();
        return isset($this->fullConfiguration['properties']) ? $this->fullConfiguration['properties'] : array();
    }

Usage Example

 /**
  * Generate a TypoScript prototype definition for a given node type
  *
  * A node will be rendered by Neos.Neos:Content by default with a template in
  * resource://PACKAGE_KEY/Private/Templates/NodeTypes/NAME.html and forwards all public
  * node properties to the template TypoScript object.
  *
  * @param NodeType $nodeType
  * @return string
  */
 public function generate(NodeType $nodeType)
 {
     if (strpos($nodeType->getName(), ':') === false) {
         return '';
     }
     $output = 'prototype(' . $nodeType->getName() . ') < prototype(' . $this->basePrototypeName . ') {' . chr(10);
     list($packageKey, $relativeName) = explode(':', $nodeType->getName(), 2);
     $templatePath = 'resource://' . $packageKey . '/Private/Templates/NodeTypes/' . $relativeName . '.html';
     $output .= "\t" . 'templatePath = \'' . $templatePath . '\'' . chr(10);
     foreach ($nodeType->getProperties() as $propertyName => $propertyConfiguration) {
         if (isset($propertyName[0]) && $propertyName[0] !== '_') {
             $output .= "\t" . $propertyName . ' = ${q(node).property("' . $propertyName . '")}' . chr(10);
             if (isset($propertyConfiguration['type']) && isset($propertyConfiguration['ui']['inlineEditable']) && $propertyConfiguration['type'] === 'string' && $propertyConfiguration['ui']['inlineEditable'] === true) {
                 $output .= "\t" . $propertyName . '[email protected] = Neos.Neos:ConvertUris' . chr(10);
             }
         }
     }
     $output .= '}' . chr(10);
     return $output;
 }
All Usage Examples Of Neos\ContentRepository\Domain\Model\NodeType::getProperties