Browse Source

[SoftDeleteable] Minor optimizations

comfortablynumb 13 years ago
parent
commit
5603e061ea

+ 3 - 3
lib/Gedmo/SoftDeleteable/Filter/SoftDeleteableFilter.php

@@ -36,7 +36,7 @@ class SoftDeleteableFilter extends SQLFilter
 
     protected function getConfiguration(ClassMetadata $meta)
     {
-        if (is_null($this->configuration)) {
+        if ($this->configuration === null) {
             $refl = new \ReflectionProperty('Doctrine\ORM\Query\Filter\SQLFilter', 'em');
             $refl->setAccessible(true);
             $em = $refl->getValue($this);
@@ -51,12 +51,12 @@ class SoftDeleteableFilter extends SQLFilter
                     }
                 }
 
-                if (!is_null($this->configuration)) {
+                if ($this->configuration === null) {
                     break;
                 }
             }
 
-            if (is_null($this->configuration)) {
+            if ($this->configuration === null) {
                 throw new \RuntimeException('Listener "SoftDeleteableListener" was not added to the EventManager!');
             }
         }

+ 0 - 1
lib/Gedmo/SoftDeleteable/SoftDeleteableListener.php

@@ -50,7 +50,6 @@ class SoftDeleteableListener extends MappedEventSubscriber
 
             if (isset($config['softDeleteable']) && $config['softDeleteable']) {
                 $reflProp = $meta->getReflectionProperty($config['fieldName']);
-                $reflProp->setAccessible(true);
                 $date = new \DateTime();
                 $oldValue = $reflProp->getValue($entity);
                 $reflProp->setValue($entity, $date);