<commit_before><?php
namespace SPHERE\System\Database\Fitting;

use Doctrine\Common\Collections\Selectable;
use Doctrine\Common\Persistence\ObjectRepository;
use Doctrine\ORM\EntityRepository;

/**
 * Class Repository
 *
 * @package SPHERE\System\Database\Fitting
 */
class Repository extends EntityRepository implements ObjectRepository, Selectable
{

    /**
     * @return int
     */
    public function count()
    {

        $Query = $this->createQueryBuilder('e')->select('count(e)')->getQuery()
            ->useQueryCache(true)->useResultCache(true);
        return $Query->getSingleScalarResult();
    }

    /**
     * @param $Criteria
     *
     * @return int
     */
    public function countBy($Criteria = array())
    {

        $EntityPersister = $this->_em->getUnitOfWork()->getEntityPersister($this->_entityName);
        return $EntityPersister->count($Criteria);
    }
}
<commit_msg>Fix: Count Result-Cache not working properly -> disabled<commit_after><?php
namespace SPHERE\System\Database\Fitting;

use Doctrine\Common\Collections\Selectable;
use Doctrine\Common\Persistence\ObjectRepository;
use Doctrine\ORM\EntityRepository;

/**
 * Class Repository
 *
 * @package SPHERE\System\Database\Fitting
 */
class Repository extends EntityRepository implements ObjectRepository, Selectable
{

    /**
     * @return int
     */
    public function count()
    {

        $Query = $this->createQueryBuilder('e')->select('count(e)')->getQuery()
            ->useQueryCache(true);
        return $Query->getSingleScalarResult();
    }

    /**
     * @param $Criteria
     *
     * @return int
     */
    public function countBy($Criteria = array())
    {

        $EntityPersister = $this->_em->getUnitOfWork()->getEntityPersister($this->_entityName);
        return $EntityPersister->count($Criteria);
    }
}

{'fraction_non_alphanumeric': 0.1366867140513942, 'fraction_numerical': 0.0, 'mean_word_length': 3.245939675174014, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, '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': '3614591', 'n_tokens_mistral': 521, 'n_tokens_neox': 514, 'n_words': 90}