1 | <?php |
||
13 | class ImageStrategy implements ListenerAggregateInterface |
||
14 | { |
||
15 | /** |
||
16 | * @var \Zend\Stdlib\CallbackHandler[] |
||
17 | */ |
||
18 | protected $listeners = []; |
||
19 | |||
20 | /** |
||
21 | * @var ImagineInterface |
||
22 | */ |
||
23 | protected $imagine; |
||
24 | |||
25 | /** |
||
26 | * Constructor |
||
27 | * |
||
28 | * @param ImagineInterface $imagine |
||
29 | */ |
||
30 | 3 | public function __construct(ImagineInterface $imagine) |
|
34 | |||
35 | /** |
||
36 | * {@inheritDoc} |
||
37 | */ |
||
38 | public function attach(EventManagerInterface $events, $priority = 1) |
||
43 | |||
44 | /** |
||
45 | * {@inheritDoc} |
||
46 | */ |
||
47 | public function detach(EventManagerInterface $events) |
||
55 | |||
56 | /** |
||
57 | * Sets ImageRenderer as Renderer when ImageModel is used |
||
58 | * |
||
59 | * @param ViewEvent $e |
||
60 | * @return ImageRenderer|null |
||
61 | * @throws Exception\RuntimeException |
||
62 | */ |
||
63 | 2 | public function selectRenderer(ViewEvent $e) |
|
79 | |||
80 | /** |
||
81 | * Sets the response based on image returned by the renderer |
||
82 | * |
||
83 | * @param ViewEvent $e |
||
84 | * @return void |
||
85 | */ |
||
86 | public function injectResponse(ViewEvent $e) |
||
98 | |||
99 | /** |
||
100 | * Internal |
||
101 | * |
||
102 | * Get the mime type based on format. |
||
103 | * |
||
104 | * @param string $format |
||
105 | * |
||
106 | * @return string mime-type |
||
107 | * |
||
108 | * @throws RuntimeException |
||
109 | */ |
||
110 | protected function getMimeType($format) |
||
124 | } |
||
125 |