$this->entityManager =
$entityManager;
} /**
* Saves the given container to the database, files or wherever.
*
* @param Template $reference
*/
public function save(ContainerInterface
$container,
$reference) { $this->
saveContainer($container,
$reference);
$this->entityManager->
flush();
} private function saveContainer(ContainerInterface
$container, Template
$template, ?Layout
$parent = null
): void
{ $class = \
get_class($container);
$entity =
$this->
createContainer($container,
$template,
$parent);
// Do class switch to route the container to the responsible save function.
switch ($class) {