<?php

namespace Vin\FrontOfficeBundle\Entity;

use Doctrine\ORM\EntityRepository;

/**
 * MessageRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class MessageRepository extends EntityRepository
{
    public function countMessages()
    {
        $query = $this -> getEntityManager()->createQuery('
            SELECT COUNT(m.id)
            FROM VinFrontOfficeBundle:Message m');

        return $query ->getSingleScalarResult();
    }

}
