|
@@ -169,6 +169,7 @@ class SortableListener extends MappedEventSubscriber
|
|
{
|
|
{
|
|
$uow = $em->getUnitOfWork();
|
|
$uow = $em->getUnitOfWork();
|
|
|
|
|
|
|
|
+ $changed = false;
|
|
$changeSet = $uow->getEntityChangeSet($object);
|
|
$changeSet = $uow->getEntityChangeSet($object);
|
|
if (!array_key_exists($config['position'], $changeSet)) {
|
|
if (!array_key_exists($config['position'], $changeSet)) {
|
|
return;
|
|
return;
|
|
@@ -176,11 +177,19 @@ class SortableListener extends MappedEventSubscriber
|
|
$oldPosition = $changeSet[$config['position']][0];
|
|
$oldPosition = $changeSet[$config['position']][0];
|
|
$newPosition = $changeSet[$config['position']][1];
|
|
$newPosition = $changeSet[$config['position']][1];
|
|
|
|
|
|
|
|
+ $changed = $changed || $oldPosition != $newPosition;
|
|
|
|
+
|
|
// Get groups
|
|
// Get groups
|
|
$groups = array();
|
|
$groups = array();
|
|
foreach ($config['groups'] as $group) {
|
|
foreach ($config['groups'] as $group) {
|
|
|
|
+ $changed = $changed ||
|
|
|
|
+ (array_key_exists($group, $changeSet)
|
|
|
|
+ && $changeSet[$group][0] != $changeSet[$group][1]);
|
|
$groups[$group] = $meta->getReflectionProperty($group)->getValue($object);
|
|
$groups[$group] = $meta->getReflectionProperty($group)->getValue($object);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (!$changed) return;
|
|
|
|
+
|
|
// Get hash
|
|
// Get hash
|
|
$hash = $this->getHash($meta, $groups, $object);
|
|
$hash = $this->getHash($meta, $groups, $object);
|
|
|
|
|