Instalar y configurar SoftDeleteable en Symfony

De Wiki Proyectos Beta
Ir a la navegación Ir a la búsqueda

Instalar

 composer require stof/doctrine-extensions-bundle

Configurar

Doctrine

Entramos en el archivo config/packages/doctrine.yaml

Agregamos lo siguiente:

doctrine:
   orm:
      auto_mapping: true
      filters:
           softdeleteable:
               class: Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter
               enabled: true

Stof doctrine extensions

stof_doctrine_extensions:
   default_locale: en_US
   orm:
     default:
         timestampable: true
         softdeleteable: true