You are here

public function WorkflowsFieldItem::getWorkflow in Workflows Field 2.x

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldType/WorkflowsFieldItem.php \Drupal\workflows_field\Plugin\Field\FieldType\WorkflowsFieldItem::getWorkflow()

Gets the workflow associated with this field.

Return value

\Drupal\workflows\WorkflowInterface|null The workflow of NULL.

3 calls to WorkflowsFieldItem::getWorkflow()
WorkflowsFieldItem::applyDefaultValue in src/Plugin/Field/FieldType/WorkflowsFieldItem.php
Applies the default value.
WorkflowsFieldItem::getPossibleOptions in src/Plugin/Field/FieldType/WorkflowsFieldItem.php
Returns an array of possible values with labels for display.
WorkflowsFieldItem::getSettableOptions in src/Plugin/Field/FieldType/WorkflowsFieldItem.php
Returns an array of settable values with labels for display.

File

src/Plugin/Field/FieldType/WorkflowsFieldItem.php, line 177

Class

WorkflowsFieldItem
Workflow state field item.

Namespace

Drupal\workflows_field\Plugin\Field\FieldType

Code

public function getWorkflow() {
  return !empty($this
    ->getSetting('workflow')) ? Workflow::load($this
    ->getSetting('workflow')) : NULL;
}