ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilCronJobResult.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4
12{
15 const STATUS_OK = 3;
16 const STATUS_CRASHED = 4;
17 const STATUS_RESET = 5;
18 const STATUS_FAIL = 6;
19
20 const CODE_NO_RESULT = 'job_no_result';
21 const CODE_MANUAL_RESET = 'job_manual_reset';
22 const CODE_SUPPOSED_CRASH = 'job_auto_deactivation_time_limit';
23
24 protected $status; // [int]
25 protected $message; // [string]
26 protected $code; // [string]
27 protected $duration; // [float]
28
32 public static function getCoreCodes()
33 {
34 return array(
35 self::CODE_NO_RESULT, self::CODE_MANUAL_RESET, self::CODE_SUPPOSED_CRASH
36 );
37 }
38
39 public function getStatus()
40 {
41 return $this->status;
42 }
43
44 public function setStatus($a_value)
45 {
46 $a_value = (int) $a_value;
47 if (in_array($a_value, $this->getValidStatus())) {
48 $this->status = $a_value;
49 }
50 }
51
52 protected function getValidStatus()
53 {
54 return array(self::STATUS_INVALID_CONFIGURATION, self::STATUS_NO_ACTION,
55 self::STATUS_OK, self::STATUS_CRASHED, self::STATUS_FAIL);
56 }
57
58 public function getMessage()
59 {
60 return $this->message;
61 }
62
63 public function setMessage($a_value)
64 {
65 $this->message = trim($a_value);
66 }
67
68 public function getCode()
69 {
70 return $this->code;
71 }
72
73 public function setCode($a_value)
74 {
75 $this->code = $a_value;
76 }
77
78 public function getDuration()
79 {
80 return $this->duration;
81 }
82
83 public function setDuration($a_value)
84 {
85 $this->duration = number_format($a_value, 3, ".", "");
86 }
87}
An exception for terminatinating execution or to throw for unit testing.
Cron job result data container.