Returns all job item messages attached to this job item.
array $conditions: An array of conditions.
array An array of translation job item messages.
Overrides JobItemInterface::getMessages
public function getMessages($conditions = array()) {
$query = \Drupal::entityQuery('tmgmt_message')
->accessCheck(TRUE)
->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();
}