getValue() public method

gets the value from property.
public getValue ( ) : mixed
return mixed
Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function read(NodeInterface $node, PropertyInterface $property, $webspaceKey, $languageCode, $segmentKey)
 {
     if ($property->getIsBlock()) {
         /** @var BlockPropertyInterface $blockProperty */
         $blockProperty = $property;
         while (!$blockProperty instanceof BlockPropertyInterface) {
             $blockProperty = $blockProperty->getProperty();
         }
         // init properties
         $typeProperty = new Property('type', '', 'text_line');
         $lengthProperty = new Property('length', '', 'text_line');
         // load length
         $contentType = $this->contentTypeManager->get($lengthProperty->getContentTypeName());
         $contentType->read($node, new BlockPropertyWrapper($lengthProperty, $property), $webspaceKey, $languageCode, $segmentKey);
         $len = $lengthProperty->getValue();
         for ($i = 0; $i < $len; ++$i) {
             // load type
             $contentType = $this->contentTypeManager->get($typeProperty->getContentTypeName());
             $contentType->read($node, new BlockPropertyWrapper($typeProperty, $property, $i), $webspaceKey, $languageCode, $segmentKey);
             $blockPropertyType = $blockProperty->initProperties($i, $typeProperty->getValue());
             /** @var PropertyInterface $subProperty */
             foreach ($blockPropertyType->getChildProperties() as $subProperty) {
                 $contentType = $this->contentTypeManager->get($subProperty->getContentTypeName());
                 $contentType->read($node, new BlockPropertyWrapper($subProperty, $property, $i), $webspaceKey, $languageCode, $segmentKey);
             }
         }
     } else {
         throw new UnexpectedPropertyType($property, $this);
     }
 }