|
@@ 66-72 (lines=7) @@
|
| 63 |
|
* @param \Drupal\Core\Entity\EntityInterface $entity |
| 64 |
|
* The entity object. |
| 65 |
|
*/ |
| 66 |
|
function hook_entity_embed_context_alter(array &$context, \Drupal\Core\Entity\EntityInterface $entity) { |
| 67 |
|
if (isset($context['overrides']) && is_array($context['overrides'])) { |
| 68 |
|
foreach ($context['overrides'] as $key => $value) { |
| 69 |
|
$entity->key = $value; |
| 70 |
|
} |
| 71 |
|
} |
| 72 |
|
} |
| 73 |
|
|
| 74 |
|
/** |
| 75 |
|
* Alter the context of an particular embedded entity type before it is rendered. |
|
@@ 82-88 (lines=7) @@
|
| 79 |
|
* @param \Drupal\Core\Entity\EntityInterface $entity |
| 80 |
|
* The entity object. |
| 81 |
|
*/ |
| 82 |
|
function hook_ENTITY_TYPE_embed_context_alter(array &$context, \Drupal\Core\Entity\EntityInterface $entity) { |
| 83 |
|
if (isset($context['overrides']) && is_array($context['overrides'])) { |
| 84 |
|
foreach ($context['overrides'] as $key => $value) { |
| 85 |
|
$entity->key = $value; |
| 86 |
|
} |
| 87 |
|
} |
| 88 |
|
} |
| 89 |
|
|
| 90 |
|
/** |
| 91 |
|
* Alter the results of an embedded entity build array. |