1 | <?php |
||
12 | class EntityEmbedTwigExtension extends \Twig_Extension { |
||
13 | |||
14 | /** |
||
15 | * The entity type manager service. |
||
16 | * |
||
17 | * @var \Drupal\Core\Entity\EntityTypeManagerInterface |
||
18 | */ |
||
19 | protected $entityTypeManager; |
||
20 | |||
21 | /** |
||
22 | * The entity embed builder service. |
||
23 | * |
||
24 | * @var \Drupal\entity_embed\EntityEmbedBuilderInterface |
||
25 | */ |
||
26 | protected $builder; |
||
27 | |||
28 | /** |
||
29 | * Constructs a new EntityEmbedTwigExtension. |
||
30 | * |
||
31 | * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager |
||
32 | * The entity type manager service. |
||
33 | */ |
||
34 | public function __construct(EntityTypeManagerInterface $entity_type_manager, EntityEmbedBuilderInterface $builder) { |
||
38 | |||
39 | /** |
||
40 | * {@inheritdoc} |
||
41 | */ |
||
42 | public static function create(ContainerInterface $container) { |
||
48 | |||
49 | /** |
||
50 | * {@inheritdoc} |
||
51 | */ |
||
52 | public function getName() { |
||
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | public function getFunctions() { |
||
64 | |||
65 | /** |
||
66 | * Return the render array for an entity. |
||
67 | * |
||
68 | * @param string $entity_type |
||
69 | * The machine name of an entity_type like 'node'. |
||
70 | * @param string $entity_id |
||
71 | * The entity ID. |
||
72 | * @param string $display_plugin |
||
73 | * (optional) The Entity Embed Display plugin to be used to render the |
||
74 | * entity. |
||
75 | * @param array $display_settings |
||
76 | * (optional) A list of settings for the Entity Embed Display plugin. |
||
77 | * |
||
78 | * @return array |
||
79 | * A render array from entity_view(). |
||
80 | */ |
||
81 | public function getRenderArray($entity_type, $entity_id, $display_plugin = 'default', array $display_settings = []) { |
||
91 | |||
92 | } |
||
93 |