<commit_before><?php

namespace UMRA\Bundle\MemberBundle\Entity;

use Doctrine\ORM\EntityRepository;

/**
 * HouseholdRepository
 */
class HouseholdRepository extends EntityRepository
{
    public function queryAll()
    {
        $qb = $this->getEntityManager()->createQueryBuilder();

        return $qb
            ->select('h')
            ->from('UMRAMemberBundle:Household', 'h')
            ->orderBy('h.lastname', 'DESC')
            ->getQuery();
    }

    public function queryBuilderFindByName($qb, $searchTerms)
    {
        $likeTerms = '%'.$searchTerms.'%';

        return $qb->andWhere(
                        $qb->expr()->orX(
                            $qb->expr()->like('h.firstname', ':terms'),
                            $qb->expr()->like('h.lastname', ':terms'),
                            $qb->expr()->like('h.postalname', ':terms')
                        )
                    )
                ->setParameter('terms', $likeTerms)
        ;
    }<commit_msg>Fix ordering of households in HouseholdRepository#queryAll<commit_after><?php

namespace UMRA\Bundle\MemberBundle\Entity;

use Doctrine\ORM\EntityRepository;

/**
 * HouseholdRepository
 */
class HouseholdRepository extends EntityRepository
{
    public function queryAll()
    {
        $qb = $this->getEntityManager()->createQueryBuilder();

        return $qb
            ->select('h')
            ->from('UMRAMemberBundle:Household', 'h')
            ->orderBy('h.lastname', 'ASC')
            ->getQuery();
    }

    public function queryBuilderFindByName($qb, $searchTerms)
    {
        $likeTerms = '%'.$searchTerms.'%';

        return $qb->andWhere(
                        $qb->expr()->orX(
                            $qb->expr()->like('h.firstname', ':terms'),
                            $qb->expr()->like('h.lastname', ':terms'),
                            $qb->expr()->like('h.postalname', ':terms')
                        )
                    )
                ->setParameter('terms', $likeTerms)
        ;
    }
{'fraction_non_alphanumeric': 0.15776458951533134, 'fraction_numerical': 0.0, 'mean_word_length': 1.7190860215053763, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 35, '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': '3832551', 'n_tokens_mistral': 587, 'n_tokens_neox': 557, 'n_words': 85}