<commit_before><?php
namespace app\Repositories\Measurements;

use app\Models\Measurements\TaxType;
use LaravelDoctrine\ORM\Pagination\Paginatable;
use Doctrine\ORM\Query;

class TaxTypeRepository extends BaseMeasurementRepository
{

    use Paginatable;

    /**
     * Query against all fields
     * @param       []                      $query              Values to query against
     * @param       bool                    $ignorePagination   If true will not return pagination
     * @param       int|null                $maxLimit           If provided limit is greater than this value, set is to this value
     * @param       int|null                $maxPage            If the provided page is greater than this value, restrict it to this value
     * @return      array|\Illuminate\Pagination\LengthAwarePaginator
     */
    public function where($query, $ignorePagination = true, $maxLimit = 5000, $maxPage = 100)
    {
        $pagination                 =   $this->buildPagination($query, $maxLimit, $maxPage);
        $qb                         =   $this->_em->createQueryBuilder();

        $qb->select(['taxTypes']);
        $qb->from('app\Models\TaxType', 'taxTypes');
        $qb->orderBy('taxTypes.id', 'ASC');

        if ($ignorePagination)
            return $qb->getQuery()->getResult();
        else
            return $this->paginate($qb->getQuery(), $pagination['limit']);
    }


    /**
     * Get a single TaxType object by its id<commit_msg>Inclusion of helper functions<commit_after><?php
namespace app\Repositories\Measurements;

use app\Models\Measurements\TaxType;
use LaravelDoctrine\ORM\Pagination\Paginatable;
use Doctrine\ORM\Query;

class TaxTypeRepository extends BaseMeasurementRepository
{

    use Paginatable;

    /**
     * Query against all fields
     * @param       []                      $query              Values to query against
     * @param       bool                    $ignorePagination   If true will not return pagination
     * @param       int|null                $maxLimit           If provided limit is greater than this value, set is to this value
     * @param       int|null                $maxPage            If the provided page is greater than this value, restrict it to this value
     * @return      array|\Illuminate\Pagination\LengthAwarePaginator
     */
    public function where($query, $ignorePagination = true, $maxLimit = 5000, $maxPage = 100)
    {
        $pagination                 =   $this->buildPagination($query, $maxLimit, $maxPage);
        $qb                         =   $this->_em->createQueryBuilder();

        $qb->select(['taxTypes']);
        $qb->from('app\Models\TaxType', 'taxType');
        $qb->orderBy('taxType.id', 'ASC');

        if ($ignorePagination)
            return $qb->getQuery()->getResult();
        else
            return $this->paginate($qb->getQuery(), $pagination['limit']);
    }


    /**
     * Get a single TaxType object by its id
{'fraction_non_alphanumeric': 0.10615280594996619, 'fraction_numerical': 0.004732927653820149, 'mean_word_length': 2.0505154639175256, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '973970', 'n_tokens_mistral': 811, 'n_tokens_neox': 790, 'n_words': 212}