codeTemplates/src/Entity/Savers/TemplateEntityUpserter.php
public function persistUpsertDto(TemplateEntityDto $dto): TemplateEntityInterface
    {
        $entity = $this->convertUpsertDtoToEntity($dto);
        $this->saver->save($entity);

        return $entity;
    }
public function persistUpsertDto(TemplateEntityDto $dto): TemplateEntityInterface
    {
        $entity = $this->convertUpsertDtoToEntity($dto);
        $this->saver->save($entity);

        return $entity;
    }
public function persistUpsertDto ( TemplateEntityDto $ dto ) : TemplateEntityInterface { $ entity = $ this -> convertUpsertDtoToEntity ( $ dto ) ; $ this -> saver -> save ( $ entity ) ; return $ entity ; }
This is used to persist the DTO to the database. If the DTO is for a new entity then it will be created, if it
is for an existing Entity then it will be updated.

Be aware that this method should __only__ be used with DTOs that have been created using the
self::getUpsertDtoByCriteria method, as if they come from elsewhere we will not not if the entity needs to be
created or updated

@param TemplateEntityDto $dto

@return TemplateEntityInterface
@throws \Doctrine\DBAL\DBALException
This is used to persist the DTO to the database . If the DTO is for a new entity then it will be created if it is for an existing Entity then it will be updated .