<commit_before><?php
/*
 * WellCommerce Open-Source E-Commerce Platform
 *
 * This file is part of the WellCommerce package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information,
 * please view the LICENSE file that was distributed with this source code.
 */

namespace WellCommerce\Bundle\DistributionBundle\DataSet\Admin;

use WellCommerce\Bundle\CoreBundle\DataSet\AbstractDataSet;
use WellCommerce\Component\DataSet\Configurator\DataSetConfiguratorInterface;

/**
 * Class PackageDataSet
 *
 * @author <NAME> <<EMAIL>>
 */
class PackageDataSet extends AbstractDataSet
{
    /**
     * {@inheritdoc}
     */
    public function configureOptions(DataSetConfiguratorInterface $configurator)
    {
        $configurator->setColumns([
            'id'            => 'package.id',
            'name'          => 'package.name',
            'fullName'      => 'package.fullName',
            'vendor'        => 'package.vendor',
            'localVersion'  => 'package.localVersion',
            'remoteVersion' => 'package.remoteVersion',
            'createdAt'     => 'package.createdAt',
            'updatedAt'     => 'package.updatedAt',
        ]);
        
        $configurator->setColumnTransformers([
            'createdAt'     => $this->getDataSetTransformer('date', ['format' => 'Y-m-d H:i:s']),
            'updatedAt'     => $this->getDataSetTransformer('date', ['format' => 'Y-m-d H:i:s']),
            'localVersion'  => $this->getDataSetTransformer('package_version_reference'),
            'remoteVersion' => $this->getDataSetTransformer('package_version_reference')
        ]);
    }
}
<commit_msg>Moved getDataSetQueryBuilder methods from repositories to datasets<commit_after><?php
/*
 * WellCommerce Open-Source E-Commerce Platform
 *
 * This file is part of the WellCommerce package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information,
 * please view the LICENSE file that was distributed with this source code.
 */

namespace WellCommerce\Bundle\DistributionBundle\DataSet\Admin;

use Doctrine\ORM\QueryBuilder;
use WellCommerce\Bundle\CoreBundle\DataSet\AbstractDataSet;
use WellCommerce\Component\DataSet\Configurator\DataSetConfiguratorInterface;

/**
 * Class PackageDataSet
 *
 * @author <NAME> <<EMAIL>>
 */
class PackageDataSet extends AbstractDataSet
{
    /**
     * {@inheritdoc}
     */
    public function configureOptions(DataSetConfiguratorInterface $configurator)
    {
        $configurator->setColumns([
            'id'            => 'package.id',
            'name'          => 'package.name',
            'fullName'      => 'package.fullName',
            'vendor'        => 'package.vendor',
            'localVersion'  => 'package.localVersion',
            'remoteVersion' => 'package.remoteVersion',
            'createdAt'     => 'package.createdAt',
            'updatedAt'     => 'package.updatedAt',
        ]);
        
        $configurator->setColumnTransformers([
            'createdAt'     => $this->getDataSetTransformer('date', ['format' => 'Y-m-d H:i:s']),
            'updatedAt'     => $this->getDataSetTransformer('date', ['format' => 'Y-m-d H:i:s']),
            'localVersion'  => $this->getDataSetTransformer('package_version_reference'),
            'remoteVersion' => $this->getDataSetTransformer('package_version_reference'),
        ]);
    }
    
    protected function createQueryBuilder(): QueryBuilder
    {
        $queryBuilder = $this->repository->getQueryBuilder();
        $queryBuilder->groupBy('package.id');
        
        return $queryBuilder;
    }
}

{'fraction_non_alphanumeric': 0.13581964931811857, 'fraction_numerical': 0.0, 'mean_word_length': 2.739854318418314, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 58, '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': '3690811', 'n_tokens_mistral': 988, 'n_tokens_neox': 1018, 'n_words': 191}