<commit_before><?php
namespace Kunstmaan\AdminListBundle\AdminList\Configurator;

use Doctrine\ORM\PersistentCollection;
use InvalidArgumentException;

use Kunstmaan\AdminListBundle\AdminList\ListAction\ListActionInterface;
use Kunstmaan\AdminListBundle\AdminList\ItemAction\ItemActionInterface;
use Kunstmaan\AdminListBundle\AdminList\ItemAction\SimpleItemAction;
use Kunstmaan\AdminListBundle\AdminList\FilterType\FilterTypeInterface;
use Kunstmaan\AdminListBundle\AdminList\FilterBuilder;
use Kunstmaan\AdminListBundle\AdminList\Field;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\HttpFoundation\Request;

use Pagerfanta\Pagerfanta;

/**
 * Abstract admin list configurator, this implements the most common functionality from the AdminListConfiguratorInterface
 */
abstract class AbstractAdminListConfigurator implements AdminListConfiguratorInterface
{
    const SUFFIX_ADD = 'add';
    const SUFFIX_EDIT = 'edit';
    const SUFFIX_EXPORT = 'export';
    const SUFFIX_DELETE = 'delete';

    /**
     * @var Field[]
     */
    private $fields = array();

    /**
     * @var Field[]
     */
    private $exportFields = array();

    /**
     * @var ItemActionInterface[]
     */
    private $itemActions = array();

    /**
     * @var ListActionInterface[]
     */
    private $listActions = array();

    /**
     * @var AbstractType
     */
    private $type = null;

    /**
     * @var string
     */
    private $listTemplate = 'KunstmaanAdminListBundle:Default:list.html.twig';

    /**
     * @var string
     */
    private $addTemplate = 'KunstmaanAdminListBundle:Default:add_or_edit.html.twig';

    /**
     * @var string
     */
    private $editTemplate = 'KunstmaanAdminListBundle:Default:add_or_edit.html.twig';

    /**
     * @var string
     */
    private $deleteTemplate = 'KunstmaanAdminListBundle:Default:delete.html.twig';

    /**
     * @var FilterBuilder
     */
    private $filterBuilder = null;

    /**
     * @var int
     */
    protected $page = 1;

    /**
     * @var string
     */
    protected $orderBy = '';

    /**
     * @var string
     */
    protected $orderDirection = '';

    /**
     * Return current bundle name.
     *
     * @return string
     */
    abstract public function getBundleName();

    /**
     * Return current entity name.
     *
     * @return string
     */
    abstract public function getEntityName();

    /**
     * Return default repository name.
     *
     * @return string
     */
    public function getRepositoryName()
    {
        return sprintf('%s:%s', $this->getBundleName(), $this->getEntityName());
    }

    /**
     * Configure the fields you can filter on
     */
    public function buildFilters()
    {
    }

    /**
     * Configure the actions for each line
     */
    public function buildItemActions()
    {
    }

    /**
     * Configure the actions that can be executed on the whole list
     */
    public function buildListActions()
    {
    }

    /**
     * Configure the types of items you can add<commit_msg>Add reset Method for built members<commit_after><?php
namespace Kunstmaan\AdminListBundle\AdminList\Configurator;

use Doctrine\ORM\PersistentCollection;
use InvalidArgumentException;

use Kunstmaan\AdminListBundle\AdminList\ListAction\ListActionInterface;
use Kunstmaan\AdminListBundle\AdminList\ItemAction\ItemActionInterface;
use Kunstmaan\AdminListBundle\AdminList\ItemAction\SimpleItemAction;
use Kunstmaan\AdminListBundle\AdminList\FilterType\FilterTypeInterface;
use Kunstmaan\AdminListBundle\AdminList\FilterBuilder;
use Kunstmaan\AdminListBundle\AdminList\Field;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\HttpFoundation\Request;

use Pagerfanta\Pagerfanta;

/**
 * Abstract admin list configurator, this implements the most common functionality from the AdminListConfiguratorInterface
 */
abstract class AbstractAdminListConfigurator implements AdminListConfiguratorInterface
{
    const SUFFIX_ADD = 'add';
    const SUFFIX_EDIT = 'edit';
    const SUFFIX_EXPORT = 'export';
    const SUFFIX_DELETE = 'delete';

    /**
     * @var Field[]
     */
    private $fields = array();

    /**
     * @var Field[]
     */
    private $exportFields = array();

    /**
     * @var ItemActionInterface[]
     */
    private $itemActions = array();

    /**
     * @var ListActionInterface[]
     */
    private $listActions = array();

    /**
     * @var AbstractType
     */
    private $type = null;

    /**
     * @var string
     */
    private $listTemplate = 'KunstmaanAdminListBundle:Default:list.html.twig';

    /**
     * @var string
     */
    private $addTemplate = 'KunstmaanAdminListBundle:Default:add_or_edit.html.twig';

    /**
     * @var string
     */
    private $editTemplate = 'KunstmaanAdminListBundle:Default:add_or_edit.html.twig';

    /**
     * @var string
     */
    private $deleteTemplate = 'KunstmaanAdminListBundle:Default:delete.html.twig';

    /**
     * @var FilterBuilder
     */
    private $filterBuilder = null;

    /**
     * @var int
     */
    protected $page = 1;

    /**
     * @var string
     */
    protected $orderBy = '';

    /**
     * @var string
     */
    protected $orderDirection = '';

    /**
     * Return current bundle name.
     *
     * @return string
     */
    abstract public function getBundleName();

    /**
     * Return current entity name.
     *
     * @return string
     */
    abstract public function getEntityName();

    /**
     * Return default repository name.
     *
     * @return string
     */
    public function getRepositoryName()
    {
        return sprintf('%s:%s', $this->getBundleName(), $this->getEntityName());
    }

    /**
     * Configure the fields you can filter on
     */
    public function buildFilters()
    {
    }

    /**
     * Configure the actions for each line
     */
    public function buildItemActions()
    {
    }

    /**
     * Configure the actions that can be executed on the whole list
     */
    public function buildListActions()
    {
    }

    /**
     * Reset all built members
     */
    public function resetBuilds()
    {
        $this->fields = array();
        $this->exportFields = array();
        $this->filterBuilder = null;
        $this->itemActions = array();
        $this->listActions = array();
    }

    /**
     * Configure the types of items you can add
{'fraction_non_alphanumeric': 0.11422751488561579, 'fraction_numerical': 0.00031338138514572234, 'mean_word_length': 2.5759103641456584, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, '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': '1368132', 'n_tokens_mistral': 1873, 'n_tokens_neox': 1853, 'n_words': 405}