You are here

public function ProcessingContext::getField in YAML Content 8

Get the field context.

Return value

\Drupal\Core\Field\FieldItemListInterface The field currently being processed.

File

src/Plugin/ProcessingContext.php, line 43

Class

ProcessingContext
The contextual data for content being actively loaded.

Namespace

Drupal\yaml_content\Plugin

Code

public function getField() {
  if (!isset($this->field)) {

    // @todo Impelment a more specific exception.
    throw new \Exception('Missing field context.');
  }
  return $this->field;
}