Neos\ContentRepository\Domain\Model\AbstractNodeData::getProperties PHP Метод

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

If the node has a content object attached, the properties will be fetched there.
public getProperties ( ) : array
Результат array Property values, indexed by their name
    public function getProperties()
    {
        if (is_object($this->contentObjectProxy)) {
            return ObjectAccess::getGettableProperties($this->contentObjectProxy->getObject());
        }
        $properties = array();
        foreach (array_keys($this->properties) as $propertyName) {
            $properties[$propertyName] = $this->getProperty($propertyName);
        }
        return $properties;
    }

Usage Example

Пример #1
0
 /**
  * Make the node "similar" to the given source node. That means,
  *  - all properties
  *  - index
  *  - node type
  *  - content object
  * will be set to the same values as in the source node.
  *
  * @param AbstractNodeData $sourceNode
  * @param boolean $isCopy
  * @return void
  */
 public function similarize(AbstractNodeData $sourceNode, $isCopy = false)
 {
     $this->properties = [];
     foreach ($sourceNode->getProperties() as $propertyName => $propertyValue) {
         $this->setProperty($propertyName, $propertyValue);
     }
     $propertyNames = ['nodeType', 'hidden', 'hiddenAfterDateTime', 'hiddenBeforeDateTime', 'hiddenInIndex', 'accessRoles'];
     if (!$isCopy) {
         $propertyNames[] = 'creationDateTime';
         $propertyNames[] = 'lastModificationDateTime';
     }
     if ($sourceNode instanceof NodeData) {
         $propertyNames[] = 'index';
     }
     foreach ($propertyNames as $propertyName) {
         ObjectAccess::setProperty($this, $propertyName, ObjectAccess::getProperty($sourceNode, $propertyName));
     }
     $contentObject = $sourceNode->getContentObject();
     if ($contentObject !== null) {
         $this->setContentObject($contentObject);
     }
 }