You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- <?php
-
- namespace Lc\CaracoleBundle\Solver\PointSale;
-
- use Lc\CaracoleBundle\Model\PointSale\PointSaleInterface;
- use Lc\CaracoleBundle\Model\Section\SectionInterface;
-
- class PointSaleSolver
- {
-
- public function labelAdminChoice(PointSaleInterface $pointSale): string
- {
- if ($pointSale->getIsPublic()) {
- return '[Public] ' . $pointSale->getTitle();
- } else {
- return '[Privée] ' . $pointSale->getTitle();
- }
- }
-
- public function getSummary(PointSaleInterface $pointSale): string
- {
- $html = '';
-
- if ($pointSale->getTitle()) {
- $html .= $pointSale->getTitle() . '<br />';
- }
-
- if ($pointSale->getAddress()) {
- $html .= $pointSale->getAddress()->getAddress() . '<br />';
- }
-
- if ($pointSale->getAddress()->getZip() || $pointSale->getAddress()->getCity()) {
- $html .= $pointSale->getAddress()->getZip() . ' ' . $pointSale->getAddress()->getCity() . '<br />';
- }
-
- return $html;
- }
-
- public function getOrderAmountMin(PointSaleInterface $pointSale, SectionInterface $section)
- {
- foreach($pointSale->getPointSaleSections() as $pointSaleSection) {
- if($pointSaleSection->getSection()->getId() == $section->getId()) {
- $orderAmountMin = $pointSaleSection->getOrderAmountMin();
-
- if(!is_null($orderAmountMin)) {
- return $orderAmountMin;
- }
- }
- }
-
- return $pointSale->getOrderAmountMin();
- }
- }
|