Skip to content

Instantly share code, notes, and snippets.

@muspelheim
Forked from kbsali/BlablaAdmin.php
Created May 31, 2017 10:04
Show Gist options
  • Save muspelheim/6e762200ec6be1c490a29187b0d68610 to your computer and use it in GitHub Desktop.
Save muspelheim/6e762200ec6be1c490a29187b0d68610 to your computer and use it in GitHub Desktop.
Disable soft DoctrineExtensions' SoftDeleteable in Sonata Admin list view
<?php
...
class BlablaAdmin extends Admin
{
...
public function createQuery($context = 'list')
{
$query = parent::createQuery($context);
$em = $query->getQueryBuilder()->getEntityManager();
$em->getFilters()->disable('softdeleteable');
return $query;
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment