/**
  * Update certain properties of the Ticket by key
  *
  * @ApiDoc(
  *  description="Update ticket by key",
  *  uri="/tickets/{key}.{_format}",
  *  method={
  *      "PUT",
  *      "PATCH"
  *  },
  *  resource=true,
  *  requirements={
  *      {
  *          "name"="key",
  *          "dataType"="string",
  *          "requirement"="^.*-[0-9]+$",
  *          "description"="Ticket Key"
  *      }
  *  },
  *  statusCodes={
  *      200="Returned when successful",
  *      403="Returned when the user is not authorized to update ticket",
  *      404="Returned when the ticket is not found"
  *  }
  * )
  *
  * @param Command\UpdatePropertiesCommand $command
  * @return \Diamante\DeskBundle\Model\Ticket\Ticket
  */
 public function updatePropertiesByKey(Command\UpdatePropertiesCommand $command)
 {
     return parent::updatePropertiesByKey($command);
 }
 /**
  * @expectedException \RuntimeException
  * @expectedExceptionMessage Ticket loading failed, ticket not found.
  */
 public function testDeleteTicketByKeyWhenTicketDoesNotExist()
 {
     $this->ticketRepository->expects($this->once())->method('getByTicketKey')->with(new TicketKey('DT', 1))->will($this->returnValue(null));
     $this->ticketService->deleteTicketByKey(self::DUMMY_TICKET_KEY);
 }
 /**
  * Retrieves Person (Provider or Assignee) Data based on typed ID provided
  *
  * @ApiDoc(
  *  description="Returns person data",
  *  uri="/ticket/{id}/assignee.{_format}",
  *  method="GET",
  *  resource=true,
  *  requirements={
  *       {
  *           "name"="id",
  *           "dataType"="integer",
  *           "requirement"="\d+",
  *           "description"="Ticket Id"
  *       }
  *   },
  *  statusCodes={
  *      200="Returned when successful",
  *      403="Returned when the user is not authorized to view tickets"
  *  }
  * )
  *
  * @param $id
  * @return array
  */
 public function getAssigneeForTicket($id)
 {
     $ticket = parent::loadTicket($id);
     $assignee = $ticket->getAssignee();
     $details = [];
     if (!empty($assignee)) {
         $assigneeAdapter = new User($assignee->getId(), User::TYPE_ORO);
         $details = $this->userService->fetchUserDetails($assigneeAdapter);
     }
     return $details;
 }