Chris@0: getSetting('text source') === NULL) { Chris@0: throw new \InvalidArgumentException("The definition's 'text source' key has to specify the name of the text property to be processed."); Chris@0: } Chris@0: } Chris@0: Chris@0: /** Chris@0: * {@inheritdoc} Chris@0: */ Chris@0: public function getValue() { Chris@0: if ($this->processed !== NULL) { Chris@0: return $this->processed; Chris@0: } Chris@0: Chris@0: $item = $this->getParent(); Chris@0: $text = $item->{($this->definition->getSetting('text source'))}; Chris@0: Chris@0: // Avoid running check_markup() on empty strings. Chris@0: if (!isset($text) || $text === '') { Chris@0: $this->processed = ''; Chris@0: } Chris@0: else { Chris@0: $this->processed = check_markup($text, $item->format, $item->getLangcode()); Chris@0: } Chris@0: return $this->processed; Chris@0: } Chris@0: Chris@0: /** Chris@0: * {@inheritdoc} Chris@0: */ Chris@0: public function setValue($value, $notify = TRUE) { Chris@0: $this->processed = $value; Chris@0: // Notify the parent of any changes. Chris@0: if ($notify && isset($this->parent)) { Chris@0: $this->parent->onChange($this->name); Chris@0: } Chris@0: } Chris@0: Chris@0: }