|
|
|
|
|
|
|
|
$total = $entityRepo->count(array('status' => 1, 'parent' => $entity->getParent()->getId())); |
|
|
$total = $entityRepo->count(array('status' => 1, 'parent' => $entity->getParent()->getId())); |
|
|
$entity->setPosition($entity->getParent()->getId() . '_' . $total); |
|
|
$entity->setPosition($entity->getParent()->getId() . '_' . $total); |
|
|
} else { |
|
|
} 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); |
|
|
$entity->setPosition($total); |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} 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); |
|
|
$entity->setPosition($total); |
|
|
} |
|
|
} |
|
|
return $entity; |
|
|
return $entity; |