<commit_before><?php

/*
 * This file is part of the CRUDlex package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace CRUDlex;

use CRUDlex\CRUDEntityDefinition;
use CRUDlex\CRUDEntity;
use Symfony\Component\HttpFoundation\Request;

abstract class CRUDData {

    protected $definition;

    protected $fileProcessor;

    protected function hydrate($row) {
        if (!$row) {
            return null;
        }
        $fieldNames = $this->definition->getFieldNames();
        $entity = new CRUDEntity($this->definition);
        foreach ($fieldNames as $fieldName) {
            $entity->set($fieldName, $row[$fieldName]);
        }
        return $entity;
    }

    public abstract function get($id);

    public abstract function listEntries(array $selection = array());

    public abstract function create(CRUDEntity $entity);

    public abstract function update(CRUDEntity $entity);

    public abstract function delete($id);

    public abstract function getReferences($table, $nameField);

    public abstract function countBy($table, $params, $paramsOperators, $includeDeleted);

    public abstract function fetchReferences($entity);

    public function getDefinition() {
        return $this->definition;
    }
<commit_msg>removed unused check<commit_after><?php

/*
 * This file is part of the CRUDlex package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace CRUDlex;

use CRUDlex\CRUDEntityDefinition;
use CRUDlex\CRUDEntity;
use Symfony\Component\HttpFoundation\Request;

abstract class CRUDData {

    protected $definition;

    protected $fileProcessor;

    protected function hydrate($row) {
        $fieldNames = $this->definition->getFieldNames();
        $entity = new CRUDEntity($this->definition);
        foreach ($fieldNames as $fieldName) {
            $entity->set($fieldName, $row[$fieldName]);
        }
        return $entity;
    }

    public abstract function get($id);

    public abstract function listEntries(array $selection = array());

    public abstract function create(CRUDEntity $entity);

    public abstract function update(CRUDEntity $entity);

    public abstract function delete($id);

    public abstract function getReferences($table, $nameField);

    public abstract function countBy($table, $params, $paramsOperators, $includeDeleted);

    public abstract function fetchReferences($entity);

    public function getDefinition() {
        return $this->definition;
    }

{'fraction_non_alphanumeric': 0.10265024262784621, 'fraction_numerical': 0.0, 'mean_word_length': 3.519392917369309, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, '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': '2326418', 'n_tokens_mistral': 734, 'n_tokens_neox': 709, 'n_words': 220}