public function TMGMTJobItem::getMessages in Translation Management Tool 7
Returns all job messages attached to this job item.
Return value
array An array of translation job messages.
1 call to TMGMTJobItem::getMessages()
- TMGMTJobItem::getMessagesSince in entity/
tmgmt.entity.job_item.inc - Returns all job messages attached to this job item with timestamp newer than $time.
File
- entity/
tmgmt.entity.job_item.inc, line 797
Class
- TMGMTJobItem
- Entity class for the tmgmt_job entity.
Code
public function getMessages($conditions = array()) {
$query = new EntityFieldQuery();
$query
->entityCondition('entity_type', 'tmgmt_message');
$query
->propertyCondition('tjiid', $this->tjiid);
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();
}