<commit_before><?php

namespace Cacic\CommonBundle\Entity;

use Doctrine\ORM\EntityRepository;

/**
 *
 * Repositório de métodos de consulta em DQL
 * @author lightbase
 *
 */
class SoftwareRepository extends EntityRepository
{
    public function paginar( \Knp\Component\Pager\Paginator $paginator, $page = 1 )
    {
        $_dql = "SELECT s, tipoSW.teDescricaoTipoSoftware AS tipoSoftware
				FROM CacicCommonBundle:Software s
				LEFT JOIN s.idTipoSoftware tipoSW
				ORDER BY s.nmSoftware ASC";

        return $paginator->paginate(
            $this->getEntityManager()->createQuery( $_dql ),
            $page,
            10
        );
    }
    /**
     *
     * Método de listagem dos Software cadastrados e respectivas informações
     */
    public function listar()
    {
        $_dql = "SELECT s, tipoSW.teDescricaoTipoSoftware AS tipoSoftware
				FROM CacicCommonBundle:Software s
				LEFT JOIN s.idTipoSoftware tipoSW
				ORDER BY s.nmSoftware ASC";

        return $this->getEntityManager()->createQuery( $_dql )->getArrayResult();
    }

    public function listarSoftware()
    {
        $qb = $this->createQueryBuilder('sw')
            ->select('sw.nmSoftware','sw.idSoftware')
            ->innerJoin('CacicCommonBundle:PropriedadeSoftware', 'prop', 'WITH', 'sw.idSoftware = prop.software')
            ->innerJoin('CacicCommonBundle:ClassProperty', 'class','WITH', 'prop.classProperty = class.idClassProperty')
            ->groupBy('sw.nmSoftware, sw.idSoftware')
            ->orderBy('sw.nmSoftware');

        return $qb->getQuery()->execute();
    }

    /**
     *
     * Método de listagem dos Softwares cadastrados que não foram classificados (sem Tipo de Software)
     */
    public function listarNaoClassificados( \Knp\Component\Pager\Paginator $paginator, $page = 1)
    {
        $qb = $this->createQueryBuilder('sw')
            ->select('sw.nmSoftware','sw.idSoftware')
            ->innerJoin('CacicCommonBundle:PropriedadeSoftware', 'prop', 'WITH', 'sw.idSoftware = prop.software')
            ->innerJoin('CacicCommonBundle:ClassProperty', 'class','WITH', 'prop.classProperty = class.idClassProperty')
            ->where('sw.idTipoSoftware is null')
            ->groupBy('sw.nmSoftware,sw.idSoftware')
            ->orderBy('sw.nmSoftware');

        return $paginator->paginate(
            $qb->getQuery()->execute(),
            $page,
            10
        );

    }

    /**
     *
     * Método de listagem dos Softwares cadastrados que não estão associados a nenhuma máquina
     */
    public function listarNaoUsados( \Knp\Component\Pager\Paginator $paginator, $page = 1)
    {
        $qb = $this->createQueryBuilder('sw')
            ->select('sw.nmSoftware, sw.idSoftware')
            ->leftJoin( 'sw.estacoes ','se')<commit_msg>alterando template<commit_after><?php

namespace Cacic\CommonBundle\Entity;

use Doctrine\ORM\EntityRepository;

/**
 *
 * Repositório de métodos de consulta em DQL
 * @author lightbase
 *
 */
class SoftwareRepository extends EntityRepository
{
    public function paginar( \Knp\Component\Pager\Paginator $paginator, $page = 1 )
    {
        $_dql = "SELECT s, tipoSW.teDescricaoTipoSoftware AS tipoSoftware
				FROM CacicCommonBundle:Software s
				LEFT JOIN s.idTipoSoftware tipoSW
				ORDER BY s.nmSoftware ASC";

        return $paginator->paginate(
            $this->getEntityManager()->createQuery( $_dql ),
            $page,
            10
        );
    }
    /**
     *
     * Método de listagem dos Software cadastrados e respectivas informações
     */
    public function listar()
    {
        $_dql = "SELECT s, tipoSW.teDescricaoTipoSoftware AS tipoSoftware
				FROM CacicCommonBundle:Software s
				LEFT JOIN s.idTipoSoftware tipoSW
				ORDER BY s.nmSoftware ASC";

        return $this->getEntityManager()->createQuery( $_dql )->getArrayResult();
    }

    public function listarSoftware()
    {
        $qb = $this->createQueryBuilder('sw')
            ->select('sw.nmSoftware','sw.idSoftware')
            ->innerJoin('CacicCommonBundle:PropriedadeSoftware', 'prop', 'WITH', 'sw.idSoftware = prop.software')
            ->innerJoin('CacicCommonBundle:ClassProperty', 'class','WITH', 'prop.classProperty = class.idClassProperty')
            ->groupBy('sw.nmSoftware, sw.idSoftware')
            ->orderBy('sw.nmSoftware');

        return $qb->getQuery()->execute();
    }

    /**
     *
     * Método de listagem dos Softwares cadastrados que não foram classificados (sem Tipo de Software)
     */
    public function listarNaoClassificados()
    {
        $qb = $this->createQueryBuilder('sw')
            ->select('sw.nmSoftware','sw.idSoftware')
            ->innerJoin('CacicCommonBundle:PropriedadeSoftware', 'prop', 'WITH', 'sw.idSoftware = prop.software')
            ->innerJoin('CacicCommonBundle:ClassProperty', 'class','WITH', 'prop.classProperty = class.idClassProperty')
            ->where('sw.idTipoSoftware is null')
            ->groupBy('sw.nmSoftware,sw.idSoftware')
            ->orderBy('sw.nmSoftware');

        return $qb->getQuery()->execute();
    }

    /**
     *
     * Método de listagem dos Softwares cadastrados que não estão associados a nenhuma máquina
     */
    public function listarNaoUsados( \Knp\Component\Pager\Paginator $paginator, $page = 1)
    {
        $qb = $this->createQueryBuilder('sw')
            ->select('sw.nmSoftware, sw.idSoftware')
            ->leftJoin( 'sw.estacoes ','se')
{'fraction_non_alphanumeric': 0.12738619676945667, 'fraction_numerical': 0.0020190895741556535, 'mean_word_length': 2.714383094751193, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 56, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '671761', 'n_tokens_mistral': 1758, 'n_tokens_neox': 1617, 'n_words': 335}