1 | <?php |
||
8 | abstract class AbstractFactoryDecorator extends IdFactory |
||
9 | { |
||
10 | /** |
||
11 | * @var IdFactoryInterface |
||
12 | */ |
||
13 | private $factory; |
||
14 | |||
15 | /** |
||
16 | * Set factory used if this factory fails |
||
17 | */ |
||
18 | 5 | public function __construct(IdFactoryInterface $factory = null) |
|
22 | |||
23 | /** |
||
24 | * Create ID object from raw id string |
||
25 | * |
||
26 | * @param string $raw Raw id string |
||
27 | * @return IdInterface |
||
28 | */ |
||
29 | 5 | public function createId($raw) |
|
37 | |||
38 | /** |
||
39 | * Instantiate ID object |
||
40 | * |
||
41 | * @param string $raw Raw id string |
||
42 | * @return IdInterface |
||
43 | */ |
||
44 | abstract protected function createNewInstance($raw); |
||
45 | } |
||
46 |