Du kan inte välja fler än 25 ämnen
Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
|
- <?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();
- }
- }
|