public function reverseConvert($object)
 {
     $qb = $this->em->createQueryBuilder();
     $qb->select('a')->from('CoreBundle:Activity', 'a')->leftJoin('a.client', 'c')->where('c.company = :company')->setParameter('company', $object)->orderBy('a.createdAt', 'DESC')->setMaxResults(1);
     $activity = $qb->getQuery()->getOneOrNullResult();
     if ($activity instanceof ActivityInterface) {
         $dateConverter = new DateTimeConverter();
         return ['id' => $activity->getId(), 'createdAt' => $dateConverter->reverseConvert($activity->getCreatedAt())];
     }
     return null;
 }
 public function reverseConvertCollection($objects)
 {
     /**
      * @var ArrayCollection $objects
      * @var ActivityInterface $activity
      */
     $activity = $objects->last();
     if ($activity instanceof ActivityInterface) {
         $qb = $this->em->createQueryBuilder();
         $query = $qb->select('a')->from('CoreBundle:Activity', 'a')->where('a.user = :user')->setParameter('user', $activity->getUser())->setMaxResults(1)->orderBy('a.createdAt', 'DESC')->getQuery();
         $last = $query->getOneOrNullResult();
         if ($last instanceof ActivityInterface) {
             $converter = new DateTimeConverter();
             return ['id' => $last->getId(), 'createdAt' => $converter->reverseConvert($last->getCreatedAt()), 'updatedAt' => $converter->reverseConvert($last->getUpdatedAt()), 'note' => $last->getNote(), 'type' => $last->getType()];
         }
     }
     return null;
 }