| 1 | <?php |
||
| 6 | abstract class AbstractIdNameMap |
||
| 7 | { |
||
| 8 | private $things = []; |
||
| 9 | private $thingsById = []; |
||
| 10 | private $thingsByName = []; |
||
| 11 | |||
| 12 | abstract protected function getId($thing) : string; |
||
| 13 | |||
| 14 | abstract protected function getName($thing) : string; |
||
| 15 | |||
| 16 | public function update(array $things) |
||
| 24 | |||
| 25 | public function byId($id) |
||
| 33 | |||
| 34 | public function byName($name) |
||
| 42 | |||
| 43 | public function getMap() : array |
||
| 53 | } |