Diferencia entre revisiones de «Instalar y configurar SoftDeleteable en Symfony»

De Wiki Proyectos Beta
Ir a la navegación Ir a la búsqueda
(feat: add Instalar y configurar SoftDeleteable en Symfony)
 
 
(No se muestran 4 ediciones intermedias del mismo usuario)
Línea 13: Línea 13:
  doctrine:
  doctrine:
     orm:
     orm:
        entity_managers:
      auto_mapping: true
            default:
      filters:
                filters:
            softdeleteable:
                    softdeleteable:
                class: Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter
                        class: Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter
                enabled: true
                        enabled: true


=== Stof doctrine extensions ===
=== Stof doctrine extensions ===
stof_doctrine_extensions:
    default_locale: en_US
    orm:
      default:
          timestampable: true
          softdeleteable: true

Revisión actual - 10:10 1 sep 2024

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