Api Platform Softdeleteable扩展程序不会筛选已删除的实体,但会正确设置删除日期

时间:2018-09-28 12:54:10

标签: php symfony api-platform.com

Api平台(Symfony 4)。

尽管删除了一个实体,该实体仍然出现在列表中,但是数据库中的delete_at字段设置正确。 侦听器运行良好,但过滤器似乎无法正常工作。

配置:

true

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

orm:
    auto_generate_proxy_classes: '%kernel.debug%'
    naming_strategy: doctrine.orm.naming_strategy.underscore
    auto_mapping: true
    mappings:
        [...]
        gedmo_loggable:
            type: annotation
            prefix: Gedmo\Loggable\Entity
            dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Loggable/Entity"
            is_bundle: false
            alias: Gedmo
        gedmo_tree:
            type: annotation
            prefix: Gedmo\Tree\Entity
            dir: "%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Entity"
            is_bundle: false
            alias: Tree
    filters:
        softdeleteable:
            class: Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter
            enabled: true

resources:
    App\Entity\Folder:
        attributes:
            pagination_enabled: false
        itemOperations:
            delete: ~
            put: ~
            get: ~
        collectionOperations:
            get: 
                filters: ['catalogue.order_filter']

0 个答案:

没有答案