public function getMyChats(Request $request){
        
        /** @var LoginHelper $loginHelper */
        $loginHelper = $this->container->get('sopinet_login_helper');
        try {
            $user = $loginHelper->getUser($request);
        } catch(Exception $e) {
            throw new Exception($e->getMessage());
        }

        $em = $this->container->get('doctrine.orm.default_entity_manager');

        /** @var ChatRepository $reChat */
        $reChat = $em->getRepository('SopinetChatBundle:Chat');

        $all = $reChat->findAll();

        $chats = array();

        /** @var Chat $chat */
        foreach ($all as $chat){

            if($chat->getChatMembers()->contains($user)){
                $chats [] = $chat;
            }
        }

        return $chats;
    }