1 | <?php |
||
9 | class CleanupJob extends AbstractQueuedJob implements QueuedJob { |
||
|
|||
10 | |||
11 | /** |
||
12 | * How we will determine "stale" |
||
13 | * Possible values: age, number |
||
14 | * @config |
||
15 | * @var string |
||
16 | */ |
||
17 | private static $cleanup_method = "age"; |
||
18 | |||
19 | /** |
||
20 | * Value associated with cleanupMethod |
||
21 | * age => days, number => integer |
||
22 | * @config |
||
23 | * @var integer |
||
24 | */ |
||
25 | private static $cleanup_value = 30; |
||
26 | |||
27 | /** |
||
28 | * Which JobStatus values are OK to be deleted |
||
29 | * @config |
||
30 | * @var array |
||
31 | */ |
||
32 | private static $cleanup_statuses = array( |
||
33 | "Complete", |
||
34 | "Broken", |
||
35 | // "Initialising", |
||
36 | // "Running", |
||
37 | // "New", |
||
38 | // "Paused", |
||
39 | // "Cancelled", |
||
40 | // "Waiting", |
||
41 | ); |
||
42 | |||
43 | /** |
||
44 | * Check whether is enabled or not for BC |
||
45 | * @config |
||
46 | * @var boolean |
||
47 | */ |
||
48 | private static $is_enabled = false; |
||
49 | |||
50 | /** |
||
51 | * Required because we aren't extending object |
||
52 | * @return Config_ForClass |
||
53 | */ |
||
54 | public function config() { |
||
57 | |||
58 | /** |
||
59 | * Defines the title of the job |
||
60 | * @return string |
||
61 | */ |
||
62 | public function getTitle() { |
||
68 | |||
69 | /** |
||
70 | * Set immediacy of job |
||
71 | * @return int |
||
72 | */ |
||
73 | public function getJobType() { |
||
77 | |||
78 | /** |
||
79 | * Clear out stale jobs based on the cleanup values |
||
80 | */ |
||
81 | public function process() { |
||
148 | } |
||
149 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.