Sulu\Component\Content\ContentTypeInterface::read PHP Method

read() public method

Reads the value for given property from the content repository then sets the value of the Sulu property.
public read ( PHPCR\NodeInterface $node, Sulu\Component\Content\Compat\PropertyInterface $property, string $webspaceKey, string $languageCode, string $segmentKey ) : mixed
$node PHPCR\NodeInterface
$property Sulu\Component\Content\Compat\PropertyInterface
$webspaceKey string
$languageCode string
$segmentKey string
return mixed
    public function read(NodeInterface $node, PropertyInterface $property, $webspaceKey, $languageCode, $segmentKey);

Usage Example

示例#1
0
 public function testPropertyRead()
 {
     $this->property->expects($this->exactly(2))->method('getName')->will($this->returnValue('i18n:de-hotels'));
     $this->property->expects($this->once())->method('setValue')->will($this->returnCallback(function ($snippets) {
         foreach ($snippets as $snippet) {
             $this->assertTrue(UUIDHelper::isUUID($snippet));
         }
     }));
     $pageNode = $this->session->getNode('/cmf/sulu_io/contents/hotels');
     $this->contentType->read($pageNode, $this->property, 'sulu_io', 'de', null);
 }
All Usage Examples Of Sulu\Component\Content\ContentTypeInterface::read