/**
  * @param $tab
  * @return Ticket
  */
 protected function hydrateTicket($tab)
 {
     $ticket = new Ticket();
     $ticket->setId(isset($tab['TicketID']) ? $tab['TicketID'] : null);
     $ticket->setTitle(isset($tab['Title']) ? $tab['Title'] : null);
     $ticket->setNumber(isset($tab['TicketNumber']) ? $tab['TicketNumber'] : null);
     $ticket->setServiceId(isset($tab['ServiceID']) ? $tab['ServiceID'] : null);
     $ticket->setService(isset($tab['Service']) ? $tab['Service'] : null);
     $ticket->setTypeId(isset($tab['TypeID']) ? $tab['TypeID'] : null);
     $ticket->setType(isset($tab['Type']) ? $tab['Type'] : null);
     $ticket->setQueueId(isset($tab['QueueID']) ? $tab['QueueID'] : null);
     $ticket->setQueue(isset($tab['Queue']) ? $tab['Queue'] : null);
     $ticket->setCustomerId(isset($tab['CustomerID']) ? $tab['CustomerID'] : null);
     $ticket->setCustomer(isset($tab['Customer']) ? $tab['Customer'] : null);
     $ticket->setCustomerUserId(isset($tab['CustomerUserID']) ? $tab['CustomerUserID'] : null);
     $ticket->setCustomerUser(isset($tab['CustomerUser']) ? $tab['CustomerUser'] : null);
     $ticket->setPriorityId(isset($tab['PriorityID']) ? $tab['PriorityID'] : null);
     $ticket->setPriority(isset($tab['Priority']) ? $tab['Priority'] : null);
     $ticket->setStateId(isset($tab['StateID']) ? $tab['StateID'] : null);
     $ticket->setState(isset($tab['State']) ? $tab['State'] : null);
     $ticket->setOwnerId(isset($tab['OwnerID']) ? $tab['OwnerID'] : null);
     $ticket->setOwner(isset($tab['Owner']) ? $tab['Owner'] : null);
     $ticket->setDateChanged(isset($tab['Changed']) ? new \DateTime($tab['Changed']) : null);
     $ticket->setDateCreated(isset($tab['Created']) ? new \DateTime($tab['Created']) : null);
     //Affiliation du client
     $clients = $this->clientConnector->getClients();
     foreach ($clients as $client) {
         if ($client->getCustomerCode() == $ticket->getCustomerId()) {
             $ticket->setCustomer($client->getName());
         }
     }
     // @rp_toto : pour test
     //        $ticket->setCustomerId('CL13115');
     //        $ticket->setServiceId(1);
     //        $ticket->setTypeId(1);
     if (isset($tab['Article'])) {
         if (count($tab['Article'])) {
             foreach ($tab['Article'] as $tabArticle) {
                 $article = new Article();
                 $article->setId(isset($tabArticle['ArticleID']) ? $tabArticle['ArticleID'] : null);
                 $article->setReference(isset($tabArticle['References']) ? $tabArticle['References'] : null);
                 $article->setSubject(isset($tabArticle['Subject']) ? $tabArticle['Subject'] : null);
                 $article->setBody(isset($tabArticle['Body']) ? $tabArticle['Body'] : null);
                 $article->setOwnerId(isset($tabArticle['OwnerID']) ? $tabArticle['OwnerID'] : null);
                 $article->setOwner(isset($tabArticle['Owner']) ? $tabArticle['Owner'] : null);
                 $article->setTypeId(isset($tabArticle['ArticleTypeID']) ? $tabArticle['ArticleTypeID'] : null);
                 $article->setType(isset($tabArticle['ArticleType']) ? $tabArticle['ArticleType'] : null);
                 $article->setTime(isset($tabArticle['action_time']) ? $tabArticle['action_time'] : null);
                 $article->setFrom(isset($tabArticle['From']) ? $tabArticle['From'] : null);
                 $article->setFromName(isset($tabArticle['FromRealname']) ? $tabArticle['FromRealname'] : null);
                 $article->setTo(isset($tabArticle['To']) ? $tabArticle['To'] : null);
                 $article->setDateChanged(isset($tabArticle['Changed']) ? new \DateTime($tabArticle['Changed']) : null);
                 $article->setDateCreated(isset($tabArticle['Created']) ? new \DateTime($tabArticle['Created']) : null);
                 $ticket->addArticles($article);
             }
         }
     }
     return $ticket;
 }