1 | <?php |
||
35 | class Process |
||
36 | { |
||
37 | const STATE_RUNNING = 'running'; |
||
38 | const STATE_CANCELLED = 'cancelled'; |
||
39 | const STATE_COMPLETED = 'completed'; |
||
40 | |||
41 | /** |
||
42 | * @var array |
||
43 | */ |
||
44 | protected $row; |
||
45 | |||
46 | /** |
||
47 | * @param array $row |
||
48 | */ |
||
49 | 22 | public function __construct($row = []) |
|
53 | |||
54 | /** |
||
55 | * Returns the activity state for this process |
||
56 | * |
||
57 | * @param void |
||
58 | * @return boolean |
||
59 | */ |
||
60 | 1 | public function getActive() |
|
64 | |||
65 | /** |
||
66 | * Returns the identifier for the process |
||
67 | * |
||
68 | * @return string |
||
69 | */ |
||
70 | 2 | public function getProcess_id() |
|
74 | |||
75 | /** |
||
76 | * Returns the timestamp of the exectime for the first relevant queue item. |
||
77 | * This can be used to determine the runtime |
||
78 | * |
||
79 | * @return int |
||
80 | */ |
||
81 | public function getTimeForFirstItem() |
||
88 | |||
89 | /** |
||
90 | * Returns the timestamp of the exectime for the last relevant queue item. |
||
91 | * This can be used to determine the runtime |
||
92 | * |
||
93 | * @return int |
||
94 | */ |
||
95 | public function getTimeForLastItem() |
||
102 | |||
103 | /** |
||
104 | * Returns the difference between first and last processed item |
||
105 | * |
||
106 | * @return int |
||
107 | */ |
||
108 | 5 | public function getRuntime() |
|
112 | |||
113 | /** |
||
114 | * Returns the ttl of the process |
||
115 | * |
||
116 | * @return int |
||
117 | */ |
||
118 | 1 | public function getTTL() |
|
122 | |||
123 | /** |
||
124 | * Counts the number of items which need to be processed |
||
125 | * |
||
126 | * @return int |
||
127 | */ |
||
128 | public function countItemsProcessed() |
||
133 | |||
134 | /** |
||
135 | * Counts the number of items which still need to be processed |
||
136 | * |
||
137 | * @return int |
||
138 | */ |
||
139 | public function countItemsToProcess() |
||
144 | |||
145 | /** |
||
146 | * Returns the Progress of a crawling process as a percentage value |
||
147 | * |
||
148 | * @return float |
||
149 | */ |
||
150 | 5 | public function getProgress() |
|
164 | |||
165 | /** |
||
166 | * Returns the number of assigned entries |
||
167 | * |
||
168 | * @return int |
||
169 | */ |
||
170 | 1 | public function countItemsAssigned() |
|
174 | |||
175 | /** |
||
176 | * Return the processes current state |
||
177 | * |
||
178 | * @return string |
||
179 | */ |
||
180 | 4 | public function getState() |
|
191 | |||
192 | /** |
||
193 | * Returns the properties of the object as array |
||
194 | * |
||
195 | * @return array |
||
196 | */ |
||
197 | public function getRow() |
||
201 | } |
||
202 |