public function LocalTask::getItems

Returns all local task items attached to this task.

Parameters

array $conditions: Additional conditions.

Return value

\Drupal\tmgmt_local\Entity\LocalTaskItem[] An array of local task items.

Overrides LocalTaskInterface::getItems

File

translators/tmgmt_local/src/Entity/LocalTask.php, line 211

Class

LocalTask
Entity class for the local task entity.

Namespace

Drupal\tmgmt_local\Entity

Code

public function getItems($conditions = array()) {
  $query = \Drupal::entityQuery('tmgmt_local_task_item');
  $query
    ->accessCheck(TRUE);
  $query
    ->condition('tltid', $this
    ->id());
  foreach ($conditions as $key => $condition) {
    if (is_array($condition)) {
      $operator = isset($condition['operator']) ? $condition['operator'] : '=';
      $query
        ->condition($key, $condition['value'], $operator);
    }
    else {
      $query
        ->condition($key, $condition);
    }
  }
  $query
    ->sort('tltiid');
  $results = $query
    ->execute();
  if (!empty($results)) {
    return LocalTaskItem::loadMultiple($results);
  }
  return array();
}