You are here

public function TMGMTJob::getMessages in Translation Management Tool 7

Returns all job messages attached to this job.

Return value

array An array of translation job messages.

1 call to TMGMTJob::getMessages()
TMGMTJob::getMessagesSince in entity/tmgmt.entity.job.inc
Returns all job messages attached to this job with timestamp newer than $time.

File

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

Class

TMGMTJob
Entity class for the tmgmt_job entity.

Code

public function getMessages($conditions = array()) {
  $query = new EntityFieldQuery();
  $query
    ->entityCondition('entity_type', 'tmgmt_message');
  $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_message'])) {
    return entity_load('tmgmt_message', array_keys($results['tmgmt_message']));
  }
  return array();
}