public function JobItem::getMessages in Translation Management Tool 8
Returns all job item messages attached to this job item.
Parameters
array $conditions: An array of conditions.
Return value
array An array of translation job item messages.
Overrides JobItemInterface::getMessages
1 call to JobItem::getMessages()
- JobItem::getMessagesSince in src/
Entity/ JobItem.php - Returns all job item messages attached to this job item with timestamp newer than $time.
File
- src/
Entity/ JobItem.php, line 901
Class
- JobItem
- Entity class for the tmgmt_job_item entity.
Namespace
Drupal\tmgmt\EntityCode
public function getMessages($conditions = array()) {
$query = \Drupal::entityQuery('tmgmt_message')
->condition('tjiid', $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);
}
}
$results = $query
->execute();
if (!empty($results)) {
return Message::loadMultiple($results);
}
return array();
}