Total Complexity | 9 |
Total Lines | 60 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | abstract class Field |
||
10 | { |
||
11 | /** |
||
12 | * @var array|string the cotent of the field |
||
13 | */ |
||
14 | protected $content; |
||
15 | |||
16 | /** |
||
17 | * @var Block reference to the parent block |
||
18 | */ |
||
19 | protected $block; |
||
20 | |||
21 | /** |
||
22 | * Creates the new field taking it’s content and a reference |
||
23 | * to the parent Block |
||
24 | * |
||
25 | * @param $content |
||
26 | * @param $block |
||
27 | */ |
||
28 | public function __construct($content, $block) |
||
29 | { |
||
30 | $this->content = $content; |
||
31 | $this->block = $block; |
||
32 | |||
33 | if (method_exists($this, 'init')) { |
||
34 | $this->init(); |
||
35 | } |
||
36 | } |
||
37 | |||
38 | public function content() { |
||
40 | } |
||
41 | |||
42 | public function block() { |
||
44 | } |
||
45 | |||
46 | public function has($key) { |
||
47 | return array_key_exists($key, $this->content); |
||
|
|||
48 | } |
||
49 | |||
50 | public function __get($key) { |
||
65 | } |
||
66 | } |
||
67 | |||
68 | abstract public function __toString(); |
||
69 | } |