<commit_before><?php

/**
 * @copyright   Copyright (c) 2015 ublaboo <<EMAIL>>
 * @author      <NAME> <<EMAIL>>
 * @author      <NAME> <<EMAIL>>
 * @package     Ublaboo
 */

namespace Ublaboo\DataGrid\DataSource;

use Doctrine\ORM\QueryBuilder;
use Doctrine\ORM\Tools\Pagination\Paginator;
use Nette\Utils\Strings;
use Ublaboo\DataGrid\Filter;
use Ublaboo\DataGrid\Utils\Sorting;

/**
 * @method void onDataLoaded(array $result)
 */
class DoctrineDataSource extends FilterableDataSource implements IDataSource
{

	/**
	 * Event called when datagrid data is loaded.
	 * @var callable[]
	 */
	public $onDataLoaded;

	/**
	 * @var QueryBuilder
	 */
	protected $data_source;

	/**
	 * @var string
	 */
	protected $primary_key;

	/**
	 * @var string
	 */
	protected $root_alias;

	/**
	 * @var int
	 */
	protected $placeholder = 0;


	/**
	 * @param QueryBuilder $data_source
	 * @param string       $primary_key
	 */
	public function __construct(QueryBuilder $data_source, $primary_key)
	{
		$this->data_source = $data_source;
		$this->primary_key = $primary_key;
	}


	/**
	 * @return \Doctrine\ORM\Query
	*/
	public function getQuery()
	{
		return $this->data_source->getQuery();
	}<commit_msg>DoctrineDataSource: Fixed too few parameters problem<commit_after><?php

/**
 * @copyright   Copyright (c) 2015 ublaboo <<EMAIL>>
 * @author      <NAME> <<EMAIL>>
 * @author      <NAME> <<EMAIL>>
 * @package     Ublaboo
 */

namespace Ublaboo\DataGrid\DataSource;

use Doctrine\ORM\QueryBuilder;
use Doctrine\ORM\Tools\Pagination\Paginator;
use Nette\Utils\Strings;
use Ublaboo\DataGrid\Filter;
use Ublaboo\DataGrid\Utils\Sorting;

/**
 * @method void onDataLoaded(array $result)
 */
class DoctrineDataSource extends FilterableDataSource implements IDataSource
{

	/**
	 * Event called when datagrid data is loaded.
	 * @var callable[]
	 */
	public $onDataLoaded;

	/**
	 * @var QueryBuilder
	 */
	protected $data_source;

	/**
	 * @var string
	 */
	protected $primary_key;

	/**
	 * @var string
	 */
	protected $root_alias;

	/**
	 * @var int
	 */
	protected $placeholder;


	/**
	 * @param QueryBuilder $data_source
	 * @param string       $primary_key
	 */
	public function __construct(QueryBuilder $data_source, $primary_key)
	{
		$this->placeholder = count($data_source->getParameters());
		$this->data_source = $data_source;
		$this->primary_key = $primary_key;
	}


	/**
	 * @return \Doctrine\ORM\Query
	*/
	public function getQuery()
	{
		return $this->data_source->getQuery();
	}
{'fraction_non_alphanumeric': 0.14193548387096774, 'fraction_numerical': 0.0036290322580645163, 'mean_word_length': 3.602968460111317, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 29, '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': '351227', 'n_tokens_mistral': 884, 'n_tokens_neox': 823, 'n_words': 180}