public write ( PHPCR\NodeInterface $node, Sulu\Component\Content\Compat\PropertyInterface $property, $userId, $webspaceKey, $languageCode, $segmentKey ) | ||
$node | PHPCR\NodeInterface | |
$property | Sulu\Component\Content\Compat\PropertyInterface |
public function write(NodeInterface $node, PropertyInterface $property, $userId, $webspaceKey, $languageCode, $segmentKey)
{
$value = $property->getValue();
if ($value != null) {
$node->setProperty($property->getName(), $this->removeIllegalCharacters($this->encodeValue($value)));
} else {
$this->remove($node, $property, $webspaceKey, $languageCode, $segmentKey);
}
}
/** * {@inheritdoc} */ public function write(NodeInterface $node, PropertyInterface $property, $userId, $webspaceKey, $languageCode, $segmentKey) { $value = $property->getValue(); if ($node->getIdentifier() !== null && $value === $node->getIdentifier()) { throw new \InvalidArgumentException('Internal link node cannot reference itself'); } parent::write($node, $property, $userId, $webspaceKey, $languageCode, $segmentKey); }