<?php | |||||
namespace Lc\ShopBundle\Context ; | |||||
interface DocumentUtilsInterface | |||||
{ | |||||
} |
/** | /** | ||||
* @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\OrderShopInterface", mappedBy="documents") | * @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\OrderShopInterface", mappedBy="documents") | ||||
* @ORM\JoinColumn(nullable=true) | |||||
*/ | */ | ||||
protected $orderShops; | protected $orderShops; | ||||
/** | /** | ||||
* @ORM\OneToOne(targetEntity="Lc\ShopBundle\Context\OrderRefundInterface", mappedBy="document", cascade={"persist", "remove"}) | * @ORM\OneToOne(targetEntity="Lc\ShopBundle\Context\OrderRefundInterface", mappedBy="document", cascade={"persist", "remove"}) | ||||
*/ | */ |
if(isset($params['merchant'])) { | if(isset($params['merchant'])) { | ||||
$document->setMerchant($params['merchant']) ; | $document->setMerchant($params['merchant']) ; | ||||
} | } | ||||
else { | |||||
elseif(isset($params['order_shops'])) { | |||||
$document->setMerchant($params['order_shops'][0]->getMerchant()) ; | $document->setMerchant($params['order_shops'][0]->getMerchant()) ; | ||||
} | } | ||||
foreach($params['order_shops'] as $orderShop) { | |||||
$document->addOrderShop($orderShop) ; | |||||
if(isset($params['order_shops'])) { | |||||
foreach ($params['order_shops'] as $orderShop) { | |||||
$document->addOrderShop($orderShop); | |||||
} | |||||
} | } | ||||
$document->setType($params['type']) ; | $document->setType($params['type']) ; |
namespace Lc\ShopBundle\Services ; | namespace Lc\ShopBundle\Services ; | ||||
use Lc\ShopBundle\Context\DeliveryUtilsInterface; | use Lc\ShopBundle\Context\DeliveryUtilsInterface; | ||||
use Lc\ShopBundle\Context\DocumentUtilsInterface; | |||||
use Lc\ShopBundle\Context\MerchantUtilsInterface; | use Lc\ShopBundle\Context\MerchantUtilsInterface; | ||||
use Lc\ShopBundle\Context\OrderUtilsInterface; | use Lc\ShopBundle\Context\OrderUtilsInterface; | ||||
use Lc\ShopBundle\Context\PriceUtilsInterface; | use Lc\ShopBundle\Context\PriceUtilsInterface; | ||||
PriceUtilsInterface $priceUtils, | PriceUtilsInterface $priceUtils, | ||||
DeliveryUtilsInterface $deliveryUtils, | DeliveryUtilsInterface $deliveryUtils, | ||||
CreditUtils $creditUtils, | CreditUtils $creditUtils, | ||||
DocumentUtils $documentUtils, | |||||
DocumentUtilsInterface $documentUtils, | |||||
MailUtils $mailUtils, | MailUtils $mailUtils, | ||||
TicketUtils $ticketUtils, | TicketUtils $ticketUtils, | ||||
PointLocationUtils $pointLocationUtils, | PointLocationUtils $pointLocationUtils, | ||||
return $this->creditUtils ; | return $this->creditUtils ; | ||||
} | } | ||||
public function getDocumentUtils(): DocumentUtils | |||||
public function getDocumentUtils(): DocumentUtilsInterface | |||||
{ | { | ||||
return $this->documentUtils ; | return $this->documentUtils ; | ||||
} | } |