|
|
@@ -2,6 +2,7 @@ |
|
|
|
|
|
|
|
namespace Lc\ShopBundle\Services ; |
|
|
|
|
|
|
|
use App\Entity\TicketMessage; |
|
|
|
use Doctrine\ORM\EntityManagerInterface; |
|
|
|
use Lc\ShopBundle\Context\MerchantUtilsInterface; |
|
|
|
use Lc\ShopBundle\Context\OrderShopInterface; |
|
|
@@ -56,5 +57,27 @@ class TicketUtils |
|
|
|
|
|
|
|
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 ; |
|
|
|
} |
|
|
|
} |
|
|
|
|