Просмотр исходного кода

Fix : postion d'un element nouvelement créer

master
Fab 4 лет назад
Родитель
Сommit
f39b2dac6b
1 измененных файлов: 10 добавлений и 2 удалений
  1. +10
    -2
      ShopBundle/EventSubscriber/EditEventSubscriber.php

+ 10
- 2
ShopBundle/EventSubscriber/EditEventSubscriber.php Просмотреть файл

@@ -73,11 +73,19 @@ class EditEventSubscriber implements EventSubscriberInterface
$total = $entityRepo->count(array('status' => 1, 'parent' => $entity->getParent()->getId()));
$entity->setPosition($entity->getParent()->getId() . '_' . $total);
} else {
$total = $entityRepo->count(array('status' => 1, 'parent' => null));
if ($entity instanceof FilterMerchantInterface) {
$total = $entityRepo->count(array('status' => 1, 'parent' => null, 'merchant' => $this->merchantUtils->getMerchantCurrent()));
}else{
$total = $entityRepo->count(array('status' => 1, 'parent' => null));
}
$entity->setPosition($total);
}
} else {
$total = $entityRepo->count(array('status' => 1));
if ($entity instanceof FilterMerchantInterface) {
$total = $entityRepo->count(array('status' => 1, 'merchant' => $this->merchantUtils->getMerchantCurrent()));
}else{
$total = $entityRepo->count(array('status' => 1));
}
$entity->setPosition($total);
}
return $entity;

Загрузка…
Отмена
Сохранить