Code Duplication    Length = 19-20 lines in 2 locations

src/AppBundle/Entity/GrupoRepository.php 1 location

@@ 33-51 (lines=19) @@
30
 */
31
class GrupoRepository extends EntityRepository
32
{
33
    public function getResumenPorFecha($fechas)
34
    {
35
        $data = $this->getEntityManager()
36
            ->getRepository('AppBundle:Grupo')
37
            ->createQueryBuilder('g');
38
39
        $data = RepositoryUtils::resumenConvivencia($data, $fechas)
40
            ->innerJoin('AppBundle:Alumno', 'a', 'WITH', 'a.grupo = g')
41
            ->leftJoin('AppBundle:Parte', 'p', 'WITH', 'p.alumno = a')
42
            ->leftJoin('AppBundle:Sancion', 's', 'WITH', 'p.sancion = s');
43
44
        $data = $data
45
            ->addOrderBy('g.descripcion')
46
            ->groupBy('g.id')
47
            ->getQuery()
48
            ->getResult();
49
50
        return $data;
51
    }
52
}
53

src/AppBundle/Entity/UsuarioRepository.php 1 location

@@ 33-52 (lines=20) @@
30
 */
31
class UsuarioRepository extends EntityRepository
32
{
33
    public function getResumenConvivencia($fechas)
34
    {
35
        $data = $this->getEntityManager()
36
         ->getRepository('AppBundle:Usuario')
37
         ->createQueryBuilder('u')
38
         ->select('u');
39
40
        $data = RepositoryUtils::resumenConvivencia($data, $fechas)
41
         ->leftJoin('AppBundle:Parte', 'p', 'WITH', 'p.usuario = u')
42
         ->leftJoin('AppBundle:Sancion', 's', 'WITH', 'p.sancion = s');
43
44
        $data = $data
45
            ->addOrderBy('u.apellidos')
46
            ->addOrderBy('u.nombre')
47
            ->groupBy('u.id')
48
            ->getQuery()
49
            ->getResult();
50
51
        return $data;
52
    }
53
54
    public function getRevisores()
55
    {