ResqueJob::__get()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
3
/**
4
 * Class ResqueJob
5
 *
6
 * Used in the Resque report admin
7
 *
8
 */
9
class ResqueJob extends ViewableData {
10
11
	/**
12
	 * @var array
13
	 */
14
	protected $record = array();
15
16
	/**
17
	 * @param array $data
18
	 */
19
	public function __construct($data = array()) {
20
		$this->record = $data;
21
	}
22
23
	/**
24
	 * @return string
25
	 */
26
	public function i18n_singular_name() {
27
		return 'Resque queue';
28
	}
29
30
	/**
31
	 * @return boolean
32
	 */
33
	public function canView() {
34
		return true;
35
	}
36
37
	/**
38
	 * @return bool
39
	 */
40
	public function canEdit() {
41
		return false;
42
	}
43
44
	/**
45
	 * @return bool
46
	 */
47
	public function candelete() {
48
		return false;
49
	}
50
51
	/**
52
	 * @return bool
53
	 */
54
	public function cancreate() {
55
		return false;
56
	}
57
58
	/**
59
	 * @param string $property
60
	 * @return mixed
61
	 */
62
	public function __get($property) {
63
		if(isset($this->record[$property])) {
64
			return $this->record[$property];
65
		}
66
		return null;
67
	}
68
69
}
70