<commit_before><?php

namespace AndreasGlaser\DCEventBundle\Extension\Doctrine\ORM;

use AndreasGlaser\DCEventBundle\EventListener\DCEventListener;
use Doctrine\ORM\AbstractQuery;
use Doctrine\ORM\EntityRepository as BaseEntityRepository;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Query;

/**
 * Class EntityRepository
 *
 * @package AndreasGlaser\DCEventBundle\Extension\Doctrine\ORM
 * @inheritdoc
 * @author  <NAME>
 */
class EntityRepository extends BaseEntityRepository
{
    /**
     * @var DCEventListener|null
     */
    protected $dcEventListener = null;

    /**
     * @inheritdoc
     */
    public function __construct($em, ClassMetadata $class)
    {
        parent::__construct($em, $class);
    }

    /**
     * @return \Doctrine\ORM\QueryBuilder
     *
     * @author <NAME>
     */
    protected function qb()
    {
        return $this->_em->createQueryBuilder();
    }

    /**
     * @param      $id
     * @param null $version
     *
     * @return mixed
     * @throws \Doctrine\ORM\NoResultException
     * @throws \Doctrine\ORM\NonUniqueResultException
     *
     * @author <NAME>
     */
    public function findAsArray($id, $version = null)
    {
        $qb = $this->_em->createQueryBuilder();

        $qb
            ->select('entity')
            ->from($this->_entityName, 'entity')
            ->where($qb->expr()->eq('entity.id', ':id'))
            ->setParameter(':id', $id);

        if ($version) {
            $qb
                ->andWhere($qb->expr()->eq('entity.version', ':version'))
                ->setParameter(':version', $version);
        }

        return $qb
            ->getQuery()
            ->setHint(Query::HINT_INCLUDE_META_COLUMNS, true)
            ->getSingleResult(AbstractQuery::HYDRATE_ARRAY);<commit_msg>Removed unnecessary methods<commit_after><?php

namespace AndreasGlaser\DCEventBundle\Extension\Doctrine\ORM;

use AndreasGlaser\DCEventBundle\EventListener\DCEventListener;
use Doctrine\ORM\AbstractQuery;
use Doctrine\ORM\EntityRepository as BaseEntityRepository;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Query;

/**
 * Class EntityRepository
 *
 * @package AndreasGlaser\DCEventBundle\Extension\Doctrine\ORM
 * @inheritdoc
 * @author  <NAME>
 */
class EntityRepository extends BaseEntityRepository
{
    /**
     * @var DCEventListener|null
     */
    protected $dcEventListener = null;

    /**
     * @inheritdoc
     */
    public function __construct($em, ClassMetadata $class)
    {
        parent::__construct($em, $class);
{'fraction_non_alphanumeric': 0.13170347003154576, 'fraction_numerical': 0.0, 'mean_word_length': 2.7865671641791043, 'pattern_counts': {'":': 0, '<': 9, '<?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': '5515395', 'n_tokens_mistral': 750, 'n_tokens_neox': 746, 'n_words': 129}