| 1 | <?php |
||
| 11 | abstract class Base |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var Manager |
||
| 15 | */ |
||
| 16 | protected $manager; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var MapperInterface |
||
| 20 | */ |
||
| 21 | protected $mapper; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var array specific options for this type |
||
| 25 | */ |
||
| 26 | protected $options; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var Manager $manager |
||
| 30 | * @var MapperInterface $mapper |
||
| 31 | * @var array $options |
||
| 32 | */ |
||
| 33 | 10 | public function __construct( |
|
| 42 | |||
| 43 | /** |
||
| 44 | * @param string $key Key to be retrived from user-defined mapper |
||
| 45 | */ |
||
| 46 | 6 | public function get($key) |
|
| 50 | |||
| 51 | /** |
||
| 52 | * @param array $options |
||
| 53 | * @return $this |
||
| 54 | */ |
||
| 55 | 1 | public function setOptions(array $options) |
|
| 60 | |||
| 61 | /** |
||
| 62 | * @param string $option Option key |
||
| 63 | * @param mixed $value Option value |
||
| 64 | */ |
||
| 65 | 3 | public function setOption($option, $value) |
|
| 70 | |||
| 71 | /** |
||
| 72 | * @return array |
||
| 73 | */ |
||
| 74 | 3 | public function getOptions() |
|
| 78 | |||
| 79 | /** |
||
| 80 | * Every type must run! |
||
| 81 | * @param mixed $data |
||
| 82 | * @param string $key |
||
| 83 | */ |
||
| 84 | abstract public function run(&$data, $key = null); |
||
| 85 | } |
||
| 86 |