Ver Fonte

[SoftDeleteableFilter] Small changes in filter.

GennadyMiheev há 13 anos atrás
pai
commit
c5b56c5ada

+ 5 - 4
lib/Gedmo/SoftDeleteable/Filter/SoftDeleteableFilter.php

@@ -27,16 +27,17 @@ class SoftDeleteableFilter extends SQLFilter
     {
         $config = $this->getConfiguration($targetEntity);
 
-        if (!isset($config['softDeleteable']) || !$config['softDeleteable']) {
-            return '';
+        if (isset($config['softDeleteable']) && $config['useObjectClass'] === $targetEntity->name)
+        {
+            return $targetTableAlias . '.' . $config['fieldName'] . ' IS NULL';
         }
 
-        return $targetTableAlias.'.'.$config['fieldName'].' IS NULL';
+        return '';
     }
 
     protected function getConfiguration(ClassMetadata $meta)
     {
-        if ($this->configuration === null) {
+        if (empty($this->configuration)) {
             $refl = new \ReflectionProperty('Doctrine\ORM\Query\Filter\SQLFilter', 'em');
             $refl->setAccessible(true);
             $em = $refl->getValue($this);