return [ SnippetEvents::SNIPPET_WRITTEN_EVENT => 'invalidate',
SnippetEvents::SNIPPET_DELETED_EVENT => 'invalidate',
SnippetEvents::SNIPPET_SET_DELETED_EVENT => 'invalidate',
];
} public function invalidate(EntityWrittenEvent
$event): void
{ if ($event->
getEntityName() === SnippetSetDefinition::ENTITY_NAME
) { $this->
clearCache($event->
getIds());
return;
} if ($event->
getEntityName() === SnippetDefinition::ENTITY_NAME
) { $snippetIds =
$event->
getIds();
$setIds =
$this->connection->
fetchFirstColumn( 'SELECT LOWER(HEX(snippet_set_id)) FROM snippet WHERE HEX(id) IN (:ids)',
['ids' =>
$snippetIds],
['ids' => ArrayParameterType::STRING
] );