You are here

public function TMGMTLocalTask::getItems in Translation Management Tool 7

Returns all job items attached to this task.

Return value

array An array of translation job items.

File

translators/tmgmt_local/entity/tmgmt_local.entity.task.inc, line 161

Class

TMGMTLocalTask
Entity class for the local task entity.

Code

public function getItems($conditions = array()) {
  $query = new EntityFieldQuery();
  $query
    ->entityCondition('entity_type', 'tmgmt_local_task_item');
  $query
    ->propertyCondition('tltid', $this->tltid);
  foreach ($conditions as $key => $condition) {
    if (is_array($condition)) {
      $operator = isset($condition['operator']) ? $condition['operator'] : '=';
      $query
        ->propertyCondition($key, $condition['value'], $operator);
    }
    else {
      $query
        ->propertyCondition($key, $condition);
    }
  }
  $results = $query
    ->execute();
  if (!empty($results['tmgmt_local_task_item'])) {
    return entity_load('tmgmt_local_task_item', array_keys($results['tmgmt_local_task_item']));
  }
  return array();
}