|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace Lc\ShopBundle\Services ; |
|
|
namespace Lc\ShopBundle\Services ; |
|
|
|
|
|
|
|
|
|
|
|
use App\Entity\TicketMessage; |
|
|
use Doctrine\ORM\EntityManagerInterface; |
|
|
use Doctrine\ORM\EntityManagerInterface; |
|
|
use Lc\ShopBundle\Context\MerchantUtilsInterface; |
|
|
use Lc\ShopBundle\Context\MerchantUtilsInterface; |
|
|
use Lc\ShopBundle\Context\OrderShopInterface; |
|
|
use Lc\ShopBundle\Context\OrderShopInterface; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $ticket ; |
|
|
return $ticket ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function createTicketMessage($params) |
|
|
|
|
|
{ |
|
|
|
|
|
$classTicketMessage = $this->em->getClassMetadata(TicketMessageInterface::class)->getName() ; |
|
|
|
|
|
$ticketMessage = new $classTicketMessage ; |
|
|
|
|
|
|
|
|
|
|
|
$ticket = $params['ticket'] ; |
|
|
|
|
|
|
|
|
|
|
|
$ticketMessage->setStatus(1) ; |
|
|
|
|
|
$ticketMessage->setTicket($ticket) ; |
|
|
|
|
|
$ticketMessage->setMessage($params['message']) ; |
|
|
|
|
|
$this->em->persist($ticketMessage); |
|
|
|
|
|
|
|
|
|
|
|
if(isset($params['closeTicket']) && $params['closeTicket']) { |
|
|
|
|
|
$ticket->setTicketStatus(Ticket::TICKET_STATUS_CLOSED) ; |
|
|
|
|
|
$this->em->persist($ticket); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$this->em->flush() ; |
|
|
|
|
|
|
|
|
|
|
|
return $ticketMessage ; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|