Explorar o código

[Loggable] removed isTransient() method as it seems to break stof/DoctrineExtensionsBundle

GordonsLondon %!s(int64=14) %!d(string=hai) anos
pai
achega
947b116c80

+ 1 - 14
lib/Gedmo/Loggable/AbstractLoggableListener.php

@@ -165,16 +165,7 @@ abstract class AbstractLoggableListener extends MappedEventSubscriber
     {
         return __NAMESPACE__;
     }
-    
-    /**
-     * Check if LogEntry object is not instance of
-     * LogEntry
-     * 
-     * @param object $logEntry
-     * @return bool
-     */
-    abstract protected function isTransient($logEntry);
-    
+
     /**
      * Get the LogEntry class
      *
@@ -290,10 +281,6 @@ abstract class AbstractLoggableListener extends MappedEventSubscriber
             $logEntryClass = $this->getLogEntryClass($config, $meta->name);
             $logEntry = new $logEntryClass;
             
-            if ($this->isTransient($logEntry)) {
-                throw new \Gedmo\Exception\InvalidMappingException('LogEntry class: ' . get_class($logEntry) . ' must extend AbstractLogEntry mappedsuperclass');
-            }
-            
             $logEntry->setAction($action);
             $logEntry->setUsername($this->username);
             $logEntry->setObjectClass($meta->name);

+ 0 - 8
lib/Gedmo/Loggable/LoggableListener.php

@@ -47,14 +47,6 @@ class LoggableListener extends AbstractLoggableListener
             $this->defaultLogEntryEntity;
     }
 
-    /**
-     * {@inheritdoc}
-     */
-    protected function isTransient($logEntry)
-    {
-        return !$logEntry instanceof Entity\AbstractLogEntry;
-    }
-    
     /**
      * {@inheritdoc}
      */

+ 0 - 8
lib/Gedmo/Loggable/ODM/MongoDB/LoggableListener.php

@@ -48,14 +48,6 @@ class LoggableListener extends AbstractLoggableListener
             $this->configurations[$class]['logEntryClass'] : 
             $this->defaultLogEntryDocument;
     }
-
-    /**
-     * {@inheritdoc}
-     */
-    protected function isTransient($logEntry)
-    {
-        return !$logEntry instanceof \Gedmo\Loggable\Document\AbstractLogEntry;
-    }
     
     /**
      * {@inheritdoc}