|
@@ -27,8 +27,13 @@ class SoftDeleteableFilter extends SQLFilter
|
|
|
|
|
|
public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias)
|
|
|
{
|
|
|
- if (array_key_exists($targetEntity->getName(), $this->disabled)) {
|
|
|
+ $class = $targetEntity->getName();
|
|
|
+ if (array_key_exists($class, $this->disabled) && $this->disabled[$class] === true) {
|
|
|
return '';
|
|
|
+ } elseif (array_key_exists($targetEntity->rootEntityName, $this->disabled) && $this->disabled[$targetEntity->rootEntityName] === true) {
|
|
|
+ if (!array_key_exists($class, $this->disabled) || $this->disabled[$class] !== false) {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
$config = $this->getListener()->getConfiguration($this->getEntityManager(), $targetEntity->name);
|
|
@@ -49,9 +54,7 @@ class SoftDeleteableFilter extends SQLFilter
|
|
|
|
|
|
public function enableForEntity($class)
|
|
|
{
|
|
|
- if (array_key_exists($class, $this->disabled)) {
|
|
|
- unset($this->disabled[$class]);
|
|
|
- }
|
|
|
+ $this->disabled[$class] = false;
|
|
|
}
|
|
|
|
|
|
protected function getListener()
|