Просмотр исходного кода

[Backend] création de ticket depuis admin

develop
Fab 3 лет назад
Родитель
Сommit
d099c3ca98
2 измененных файлов: 12 добавлений и 2 удалений
  1. +11
    -2
      ShopBundle/Controller/Backend/TicketController.php
  2. +1
    -0
      ShopBundle/Services/TicketUtils.php

+ 11
- 2
ShopBundle/Controller/Backend/TicketController.php Просмотреть файл



} }


public function persistEntity($entity)
public function persistTicketEntity($entity, $form)
{ {
$entity->setStatus(Ticket::TICKET_STATUS_OPEN); $entity->setStatus(Ticket::TICKET_STATUS_OPEN);
parent::persistEntity($entity);

$ticket = $this->ticketUtils->createTicket([
'user' => $entity->getUser(),
'type' => $entity->getType(),
'orderShop' => $entity->getOrderShop(),
'subject' => $entity->getSubject(),
'message' => $form->get('message')->getData(),
'answerByAdmin' =>true,
]) ;

} }


protected function createListQueryBuilder($entityClass, $sortDirection, $sortField = null, $dqlFilter = null) protected function createListQueryBuilder($entityClass, $sortDirection, $sortField = null, $dqlFilter = null)

+ 1
- 0
ShopBundle/Services/TicketUtils.php Просмотреть файл

$ticketMessage->setStatus(1) ; $ticketMessage->setStatus(1) ;
$ticketMessage->setTicket($ticket) ; $ticketMessage->setTicket($ticket) ;
$ticketMessage->setMessage($params['message']) ; $ticketMessage->setMessage($params['message']) ;
if(isset($params['answerByAdmin']) && $params['answerByAdmin'])$ticketMessage->setAnswerByAdmin(true);
$this->em->persist($ticketMessage); $this->em->persist($ticketMessage);


$this->em->flush() ; $this->em->flush() ;

Загрузка…
Отмена
Сохранить