Преглед изворни кода

[sortable] remove unnecessary call for prePersist

gedi пре 13 година
родитељ
комит
ced24501cd
1 измењених фајлова са 0 додато и 15 уклоњено
  1. 0 15
      lib/Gedmo/Sortable/SortableListener.php

+ 0 - 15
lib/Gedmo/Sortable/SortableListener.php

@@ -32,26 +32,11 @@ class SortableListener extends MappedEventSubscriber
     public function getSubscribedEvents()
     {
         return array(
-            'prePersist',
             'onFlush',
             'loadClassMetadata'
         );
     }
 
-    public function prePersist(EventArgs $args)
-    {
-        $ea = $this->getEventAdapter($args);
-        $om = $ea->getObjectManager();
-        $object = $ea->getObject();
-        $meta = $om->getClassMetadata(get_class($object));
-        if ($config = $this->getConfiguration($om, $meta->name)) {
-            if (isset($config['position'])
-                    && is_null($meta->getReflectionProperty($config['position'])->getValue($object))) {
-                $meta->getReflectionProperty($config['position'])->setValue($object, -1);
-            }
-        }
-    }
-
     /**
      * Mapps additional metadata
      *