Commit fd6f82cd authored by Mat's avatar Mat

refreshUsers, récupère le repository user

parent 0fefb182
......@@ -11,6 +11,7 @@ namespace SocketBundle\Services;
use Lexik\Bundle\JWTAuthenticationBundle\Security\Authentication\Token\JWTUserToken;
use Ratchet\ConnectionInterface;
use Ratchet\MessageComponentInterface;
use SocketBundle\Entity\User;
use Symfony\Component\DependencyInjection\ContainerInterface;
class ChatHub implements MessageComponentInterface
......@@ -143,6 +144,8 @@ class ChatHub implements MessageComponentInterface
*/
private function refreshUsers()
{
$repo = $this->getDoctrine()->getRepository(User::class);
// twig va génèrer le fragment à retourner
$twig = $this->container->get('templating');
$fragment = $twig->render('@Socket/Chat/listUsers.html.twig', array(
......@@ -162,5 +165,12 @@ class ChatHub implements MessageComponentInterface
}
}
/**
* @return \Doctrine\Bundle\DoctrineBundle\Registry|mixed|object
*/
private function getDoctrine()
{
return $this->container->get('doctrine');
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment