<commit_before><?php

namespace Cacic\CommonBundle\Entity;

use Doctrine\ORM\EntityRepository;

/**
 * ConfiguracaoLocalRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class ConfiguracaoLocalRepository extends EntityRepository
{
	/**
	 * 
	 * Lista as configurações do Local informado
	 * @param int $idLocal
	 * @return array
	 */
	public function listarPorLocal( $idLocal )
	{
		$_dql = "SELECT (CASE cl.vlConfiguracao IS NULL
                        THEN cp.vlConfiguracao
                        ELSE cl.vlConfiguracao) as vlConfiguracao,
                        cp.idConfiguracao,
                        cp.nmConfiguracao
				FROM CacicCommonBundle:ConfiguracaoPadrao cp
				LEFT JOIN CacicCommonBundle:ConfiguracaoLocal cl WITH cl.idConfiguracao = cp.idConfiguracao
				WHERE cl.idLocal = :idLocal";

        $result =  $this->getEntityManager()
        			->createQuery( $_dql )
        			->setParameter( 'idLocal', $idLocal )
        			->getArrayResult();

        if (empty($result)) {
            $_dql = "SELECT cp.vlConfiguracao, cp.idConfiguracao, cp.nmConfiguracao
				FROM CacicCommonBundle:ConfiguracaoPadrao cp";

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

        return $result;
	}<commit_msg>Corrige busca de todas as configurações por local e padrão<commit_after><?php

namespace Cacic\CommonBundle\Entity;

use Doctrine\ORM\EntityRepository;

/**
 * ConfiguracaoLocalRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class ConfiguracaoLocalRepository extends EntityRepository
{
	/**
	 * 
	 * Lista as configurações do Local informado
	 * @param int $idLocal
	 * @return array
	 */
	public function listarPorLocal( $idLocal )
	{
		$_dql = "SELECT (CASE WHEN cl.vlConfiguracao IS NULL
                        THEN cp.vlConfiguracao
                        ELSE cl.vlConfiguracao
                        END) as vlConfiguracao,
                        cp.idConfiguracao,
                        cp.nmConfiguracao
				FROM CacicCommonBundle:ConfiguracaoPadrao cp
				LEFT JOIN CacicCommonBundle:ConfiguracaoLocal cl WITH cl.idConfiguracao = cp.idConfiguracao
				WHERE cl.idLocal = :idLocal";

        $result =  $this->getEntityManager()
        			->createQuery( $_dql )
        			->setParameter( 'idLocal', $idLocal )
        			->getArrayResult();

        if (empty($result)) {
            $_dql = "SELECT cp.vlConfiguracao, cp.idConfiguracao, cp.nmConfiguracao
				FROM CacicCommonBundle:ConfiguracaoPadrao cp";

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

        return $result;
	}
{'fraction_non_alphanumeric': 0.0876944837340877, 'fraction_numerical': 0.0, 'mean_word_length': 2.3049065420560746, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '6201104', 'n_tokens_mistral': 913, 'n_tokens_neox': 835, 'n_words': 195}