created)) { $this->created = REQUEST_TIME; } if (empty($this->type)) { $this->type = 'status'; } } /** * {@inheritdoc} */ public function defaultLabel() { $created = format_date($this->created); switch ($this->type) { case 'error': return t('Error message from @time', array('@time' => $created)); case 'status': return t('Status message from @time', array('@time' => $created)); case 'warning': return t('Warning message from @time', array('@time' => $created)); case 'debug': return t('Debug message from @time', array('@time' => $created)); } } /** * Returns the translated message. * * @return * The translated message. */ public function getMessage() { $text = $this->message; if (is_array($this->variables) && !empty($this->variables)) { $text = t($text, $this->variables); } return $text; } /** * Loads the job entity that this job message is attached to. * * @return TMGMTJob * The job entity that this job message is attached to or FALSE if there was * a problem. */ public function getJob() { if (!empty($this->tjid)) { return tmgmt_job_load($this->tjid); } return FALSE; } /** * Loads the job entity that this job message is attached to. * * @return TMGMTJobItem * The job item entity that this job message is attached to or FALSE if * there was a problem. */ public function getJobItem() { if (!empty($this->tjiid)) { return tmgmt_job_item_load($this->tjiid); } return FALSE; } }