1 | <?php |
||
19 | class FormatterMediaExtension extends BaseProxyExtension |
||
|
|||
20 | { |
||
21 | /** |
||
22 | * @var \Twig_Extension |
||
23 | */ |
||
24 | protected $twigExtension; |
||
25 | |||
26 | /** |
||
27 | * @param \Twig_Extension $twigExtension |
||
28 | */ |
||
29 | public function __construct(\Twig_Extension $twigExtension) |
||
33 | |||
34 | /** |
||
35 | * {@inheritdoc} |
||
36 | */ |
||
37 | public function getAllowedTags() |
||
45 | |||
46 | /** |
||
47 | * {@inheritdoc} |
||
48 | */ |
||
49 | public function getAllowedMethods() |
||
50 | { |
||
51 | return array( |
||
52 | 'Sonata\MediaBundle\Model\MediaInterface' => array( |
||
53 | 'getproviderreference', |
||
54 | ), |
||
55 | ); |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * {@inheritdoc} |
||
60 | */ |
||
61 | public function getTokenParsers() |
||
69 | |||
70 | /** |
||
71 | * {@inheritdoc} |
||
72 | */ |
||
73 | public function getTwigExtension() |
||
77 | |||
78 | /** |
||
79 | * @param int $media |
||
80 | * @param string $format |
||
81 | * @param array $options |
||
82 | * |
||
83 | * @return string |
||
84 | */ |
||
85 | public function media($media, $format, $options = array()) |
||
89 | |||
90 | /** |
||
91 | * @param int $media |
||
92 | * @param string $format |
||
93 | * @param array $options |
||
94 | * |
||
95 | * @return string |
||
96 | */ |
||
97 | public function thumbnail($media, $format, $options = array()) |
||
101 | |||
102 | /** |
||
103 | * @param int $media |
||
104 | * @param string $format |
||
105 | * |
||
106 | * @return string |
||
107 | */ |
||
108 | public function path($media, $format) |
||
112 | } |
||
113 |