|
|
|
|
|
|
|
|
return $query->findOne(); |
|
|
return $query->findOne(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function getOneValidByDistributionAndUser( |
|
|
|
|
|
DistributionInterface $distribution, |
|
|
|
|
|
UserInterface $user, |
|
|
|
|
|
$query = null |
|
|
|
|
|
): ?OrderShopInterface |
|
|
|
|
|
{ |
|
|
|
|
|
$query = $this->createDefaultQuery($query); |
|
|
|
|
|
|
|
|
|
|
|
$query |
|
|
|
|
|
->filterByDistribution($distribution) |
|
|
|
|
|
->filterByUser($user) |
|
|
|
|
|
->filterByStatus(OrderStatusModel::$statusAliasAsValid) |
|
|
|
|
|
->filterIsNotComplementaryOrderShop() |
|
|
|
|
|
->orderBy('.cycleId', 'DESC'); |
|
|
|
|
|
|
|
|
|
|
|
return $query->findOne(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//findLastOrderValid |
|
|
//findLastOrderValid |
|
|
public function getOneLastValid($query = null): ?OrderShopInterface |
|
|
public function getOneLastValid($query = null): ?OrderShopInterface |
|
|
{ |
|
|
{ |