File config.yml
# Doctrine Configuration
doctrine:
# ...
orm:
# ...
filters:
# ...
logical_erasing_filter: MWSimple\Bundle\AdminCrudBundle\Doctrine\LogicalErasingFilter
File services.yml
services:
mwsimple.request_listener:
class: MWSimple\Bundle\AdminCrudBundle\EventListener\RequestListener
arguments: ['@doctrine.orm.entity_manager']
tags:
- { name: kernel.event_listener, event: kernel.request, method: onKernelRequest }
File is generate: Bundle/Resources/config/Post.yml (Example Entity is Post)
# ...
logical_erasing: true
# ...
File entity Post.php (Example Entity is Post)
// ...
use MWSimple\Bundle\AdminCrudBundle\Entity\LogicalErasingInterface;
// ...
class Post implements LogicalErasingInterface
// Construct.
public function __construct()
{
$this->logicalErasing = false;
}
// ...
/**
* @ORM\Column(name="logical_erasing", type="boolean")
*/
private $logicalErasing;
// ...