Skip to content

Evozon-PHP/DoctrineExtensions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Doctrine2 behavioral extensions

This package is ment to be a slight variation of the original DoctrineExtensions.

Install

composer install evozon-php/doctrine-extensions

Differences

SoftDeleteable

The original SoftDeleteable behavior was to use timestamp column that was either NULL or the date time of deletion.

While some RDBMs can index NULL-able values, some can not (like Oracle). This means it will always do a full table scan.

The modified SoftDeleatable behavior is to use a boolean (true/false) or equivalent numeric (1/0) value to represent the soft deleteable state.

Usage

Assuming you are using DoctrineBundle and StofDoctrineExtensionsBundle.

Add the filter to config.yml, or change the original softdeleteable:

orm:
    ...
    entity_managers:
        default:
            ...
            filters:
                softdeleteable:
                    class: EvozonPhp\SoftDeleteable\Filter\SoftDeleteableFilter
                    enabled: true

and add the SoftDeleteableListener to your services.yml:

services:
    evozonphp.listener.softdeleteable:
        class: EvozonPhp\SoftDeleteable\SoftDeleteableListener
        tags:
            - { name: doctrine.event_subscriber, connection: default }
        calls:
            - [ setAnnotationReader, [ "@annotation_reader" ] ]

Contributors:

Thanks to everyone participating in the development of the Doctrine2 extensions!

About

Slight variation of the original Gedmo/DoctrineExtensions

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages