/** * {@inheritdoc} */ public function load() { // Only list enabled filters. return array_filter(parent::load(), function ($entity) { return $entity->status(); }); }
/** * Load the Transitions, and filter for Workflow type. * {@inheritdoc} */ public function load() { $entities = array(); // Get the Workflow from the page. /* @var $workflow \Drupal\workflow\Entity\Workflow */ if (!($workflow = workflow_ui_url_get_workflow())) { // @todo: Generate error message. return $entities; } $wid = $url_wid = $workflow->id(); $entities = parent::load(); foreach ($entities as $key => $entity) { if (!isset($entity->wid) || $entity->wid != $wid) { unset($entities[$key]); } } return $entities; }