<commit_before><?php
/**
 * EvaEngine
 *
 * @link      https://github.com/AlloVince/eva-engine
 * @copyright Copyright (c) 2012 AlloVince (http://avnpc.com/)
 * @license   http://framework.zend.com/license/new-bsd New BSD License
 * @author    AlloVince
 */
namespace Eva\Db\TableGateway;
use Zend\Db\Adapter\Adapter,
    Zend\Db\Sql\Select,
    Zend\Db\Sql\Expression,
    Zend\Db\TableGateway\AbstractTableGateway,
    Eva\Db\ResultSet\ResultSet,
    Zend\ServiceManager\ServiceLocatorAwareInterface,
    Zend\ServiceManager\ServiceLocatorInterface,
    Eva\Db\Exception;

/**
 *
 * @category   Eva
 * @package    Eva_Db
 */
class TableGateway extends AbstractTableGateway  implements ServiceLocatorAwareInterface
{
    const ROW_COUNT_COLUMN = 'eva_row_count';

    protected $tablePrefix;
    protected $moduleTableName;
    protected $table;
    protected $tableName;
    protected $primaryKey;
    protected $uniqueIndex;

    protected $select;
    protected $selectOptions;
    protected $lastSelectString;

    protected $enableCount = false;
    protected $autoLimit = true;
    protected $lastSelectCount;

    protected $paginatorOptions = array();

    /**
    * @var ServiceLocatorInterface
    */
    protected $serviceLocator;

    protected $noResult = false;

    /**
    * Set the service locator.
    *
    * @param ServiceLocatorInterface $serviceLocator
    * @return AbstractHelper
    */
    public function setServiceLocator(ServiceLocatorInterface $serviceLocator)
    {
        $this->serviceLocator = $serviceLocator;
        return $this;
    }

    /**
     * Get the service locator.
     *
     * @return \Zend\ServiceManager\ServiceLocatorInterface
     */
    public function getServiceLocator()
    {<commit_msg>DB public parameters<commit_after><?php
/**
 * EvaEngine
 *
 * @link      https://github.com/AlloVince/eva-engine
 * @copyright Copyright (c) 2012 AlloVince (http://avnpc.com/)
 * @license   http://framework.zend.com/license/new-bsd New BSD License
 * @author    AlloVince
 */
namespace Eva\Db\TableGateway;
use Zend\Db\Adapter\Adapter,
    Zend\Db\Sql\Select,
    Zend\Db\Sql\Expression,
    Zend\Db\TableGateway\AbstractTableGateway,
    Eva\Db\ResultSet\ResultSet,
    Zend\ServiceManager\ServiceLocatorAwareInterface,
    Zend\ServiceManager\ServiceLocatorInterface,
    Eva\Db\Exception;
use Zend\Stdlib\Parameters;

/**
 *
 * @category   Eva
 * @package    Eva_Db
 */
class TableGateway extends AbstractTableGateway  implements ServiceLocatorAwareInterface
{
    const ROW_COUNT_COLUMN = 'eva_row_count';

    protected $tablePrefix;
    protected $moduleTableName;
    protected $table;
    protected $tableName;
    protected $primaryKey;
    protected $uniqueIndex;

    protected $select;
    protected $selectOptions;
    protected $lastSelectString;

    protected $enableCount = false;
    protected $autoLimit = true;
    protected $lastSelectCount;

    protected $paginatorOptions = array();

    /**
    * @var ServiceLocatorInterface
    */
    protected $serviceLocator;

    protected $noResult = false;

    public function setParameters(Parameters $params)
    {
        if($params->page){
            $this->enableCount();
        }

        if ($params->rows) {
            $this->limit((int) $params->rows);
        }

        if($params->page){
            $this->page($params->page);
        }
        
        if ($params->noLimit) {
            $this->disableLimit();
        }

        return $this;
    }

    /**
    * Set the service locator.
    *
    * @param ServiceLocatorInterface $serviceLocator
    * @return AbstractHelper
    */
    public function setServiceLocator(ServiceLocatorInterface $serviceLocator)
    {
        $this->serviceLocator = $serviceLocator;
        return $this;
    }

    /**
     * Get the service locator.
     *
     * @return \Zend\ServiceManager\ServiceLocatorInterface
     */
    public function getServiceLocator()
    {
{'fraction_non_alphanumeric': 0.10707942146663284, 'fraction_numerical': 0.0020299416391778738, 'mean_word_length': 2.8458536585365852, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 2, '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': '3423558', 'n_tokens_mistral': 1178, 'n_tokens_neox': 1168, 'n_words': 227}