1 | <?php |
||
19 | abstract class AbstractDoctrineLoader implements LoaderInterface |
||
20 | { |
||
21 | /** |
||
22 | * @var ObjectManager |
||
23 | */ |
||
24 | protected $manager; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $class; |
||
30 | |||
31 | /** |
||
32 | * @param ObjectManager $manager |
||
33 | * @param string $class |
||
34 | */ |
||
35 | public function __construct(ObjectManager $manager, string $class = null) |
||
40 | |||
41 | /** |
||
42 | * {@inheritdoc} |
||
43 | */ |
||
44 | public function find(string $identity): FileInterface |
||
62 | |||
63 | /** |
||
64 | * Map the requested path (ie. subpath in the URL) to an id that can be used to lookup the image in the Doctrine store. |
||
65 | * |
||
66 | * @param string $path |
||
67 | * |
||
68 | * @return string |
||
69 | */ |
||
70 | abstract protected function mapPathToId($path); |
||
71 | |||
72 | /** |
||
73 | * Return a stream resource from the Doctrine entity/document with the image content. |
||
74 | * |
||
75 | * @param object $image |
||
76 | * |
||
77 | * @return resource |
||
78 | */ |
||
79 | abstract protected function getStreamFromImage($image); |
||
80 | } |
||
81 |