You are here

public function TMGMTJob::getItems in Translation Management Tool 7

Returns all job items attached to this job.

Parameters

array $conditions: Additional conditions to pass into EFQ.

Return value

TMGMTJobItem[] An array of translation job items.

6 calls to TMGMTJob::getItems()
TMGMTJob::aborted in entity/tmgmt.entity.job.inc
Sets the state of the job to 'aborted'.
TMGMTJob::acceptTranslation in entity/tmgmt.entity.job.inc
Propagates the returned job item translations to the sources.
TMGMTJob::addTranslatedData in entity/tmgmt.entity.job.inc
Store translated data back into the items.
TMGMTJob::defaultLabel in entity/tmgmt.entity.job.inc
Defines the entity label if the 'entity_class_label' callback is used.
TMGMTJob::getData in entity/tmgmt.entity.job.inc
Returns the source data of all job items.

... See full list

File

entity/tmgmt.entity.job.inc, line 273

Class

TMGMTJob
Entity class for the tmgmt_job entity.

Code

public function getItems($conditions = array()) {
  $query = new EntityFieldQuery();
  $query
    ->entityCondition('entity_type', 'tmgmt_job_item');
  $query
    ->propertyCondition('tjid', $this->tjid);
  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_job_item'])) {
    return entity_load('tmgmt_job_item', array_keys($results['tmgmt_job_item']));
  }
  return array();
}