소스 검색

[SoftDeleteableFilter] Small changes in filter.

GennadyMiheev 13 년 전
부모
커밋
c5b56c5ada
1개의 변경된 파일5개의 추가작업 그리고 4개의 파일을 삭제
  1. 5 4
      lib/Gedmo/SoftDeleteable/Filter/SoftDeleteableFilter.php

+ 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);