<commit_before><?php
/*
 * This file is part of Graze DAL
 *
 * Copyright (c) 2014 Nature Delivered Ltd. <http://graze.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @see  http://github.com/graze/dal/blob/master/LICENSE
 */
namespace Graze\Dal\Adapter\ActiveRecord;

use Doctrine\Common\Persistence\ObjectRepository;
use Graze\Dal\Adapter\ActiveRecordAdapter;

class EntityRepository implements ObjectRepository
{
    protected $adapter;
    protected $entityName;

    /**
     * @param string $entityName
     * @param ActiveRecordAdapter $adapter
     */
    public function __construct($entityName, ActiveRecordAdapter $adapter)
    {
        $this->adapter = $adapter;
        $this->entityName = $entityName;
    }

    /**
     * {@inheritdoc}
     */
    public function find($id)
    {
        $unitOfWork = $this->adapter->getUnitOfWork();

        return $unitOfWork->getPersister($this->entityName)->loadById($id);
    }

    /**
     * {@inheritdoc}
     */
    public function findAll()
    {
        return $this->findBy([]);
    }

    /**
     * {@inheritdoc}
     */
    public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
    {
        $unitOfWork = $this->adapter->getUnitOfWork();

        return $unitOfWork->getPersister($this->entityName)->loadAll($criteria, $orderBy, $limit, $offset);
    }

    /**
     * {@inheritdoc}
     */
    public function findOneBy(array $criteria, array $orderBy = null)
    {
        $unitOfWork = $this->adapter->getUnitOfWork();

        return $unitOfWork->getPersister($this->entityName)->load($criteria, null, $orderBy, 1);
    }

    /**
     * {@inheritdoc}
     */
    public function getClassName()
    {<commit_msg>Removing errant variable<commit_after><?php
/*
 * This file is part of Graze DAL
 *
 * Copyright (c) 2014 Nature Delivered Ltd. <http://graze.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @see  http://github.com/graze/dal/blob/master/LICENSE
 */
namespace Graze\Dal\Adapter\ActiveRecord;

use Doctrine\Common\Persistence\ObjectRepository;
use Graze\Dal\Adapter\ActiveRecordAdapter;

class EntityRepository implements ObjectRepository
{
    protected $adapter;
    protected $entityName;

    /**
     * @param string $entityName
     * @param ActiveRecordAdapter $adapter
     */
    public function __construct($entityName, ActiveRecordAdapter $adapter)
    {
        $this->adapter = $adapter;
        $this->entityName = $entityName;
    }

    /**
     * {@inheritdoc}
     */
    public function find($id)
    {
        $unitOfWork = $this->adapter->getUnitOfWork();

        return $unitOfWork->getPersister($this->entityName)->loadById($id);
    }

    /**
     * {@inheritdoc}
     */
    public function findAll()
    {
        return $this->findBy([]);
    }

    /**
     * {@inheritdoc}
     */
    public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
    {
        $unitOfWork = $this->adapter->getUnitOfWork();

        return $unitOfWork->getPersister($this->entityName)->loadAll($criteria, $orderBy, $limit, $offset);
    }

    /**
     * {@inheritdoc}
     */
    public function findOneBy(array $criteria, array $orderBy = null)
    {
        $unitOfWork = $this->adapter->getUnitOfWork();

        return $unitOfWork->getPersister($this->entityName)->load($criteria, null, $orderBy);
    }

    /**
     * {@inheritdoc}
     */
    public function getClassName()
    {
{'fraction_non_alphanumeric': 0.1392857142857143, 'fraction_numerical': 0.0024725274725274724, 'mean_word_length': 2.80062630480167, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 41, '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': '3622345', 'n_tokens_mistral': 1108, 'n_tokens_neox': 1080, 'n_words': 235}