function TextProcessed::__construct

File

core/modules/text/src/TextProcessed.php, line 31

Class

TextProcessed
A computed property for processing text with a format.

Namespace

Drupal\text

Code

public function __construct(DataDefinitionInterface $definition, $name = NULL, ?TypedDataInterface $parent = NULL) {
  parent::__construct($definition, $name, $parent);
  if ($definition->getSetting('text source') === NULL) {
    throw new \InvalidArgumentException("The definition's 'text source' key has to specify the name of the text property to be processed.");
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.