<commit_before><?php

namespace Flowcode\ShopBundle\Repository;

use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query\Expr\Join;

/**
 * ProductRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class ProductRepository extends EntityRepository {

    public function findEnabledByPageAndCategory($category_slug = null) {
        $query = null;
        if (!is_null($category_slug)) {
            $query = $this->createQueryBuilder("p")->innerJoin("p.category", "c", Join::WITH, "c.slug = :category_slug");
            $query->setParameter("category_slug", $category_slug);
        } else {
            $query = $this->createQueryBuilder("p");
        }
        return $query;
    }
}<commit_msg>Filter productos enabled on repository<commit_after><?php

namespace Flowcode\ShopBundle\Repository;

use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query\Expr\Join;

/**
 * ProductRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class ProductRepository extends EntityRepository
{

    public function findEnabledByPageAndCategory($category_slug = null)
    {
        $query = null;
        if (!is_null($category_slug)) {
            $query = $this->createQueryBuilder("p")->innerJoin("p.category", "c", Join::WITH, "c.slug = :category_slug");
            $query->setParameter("category_slug", $category_slug);
        } else {
            $query = $this->createQueryBuilder("p");
        }
        $query->andWhere("p.enabled = 1");
        $query->addOrderBy("p.updated", "DESC");
        return $query;
    }
}
{'fraction_non_alphanumeric': 0.1332525741974561, 'fraction_numerical': 0.0006056935190793458, 'mean_word_length': 3.2577319587628866, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '4902943', 'n_tokens_mistral': 468, 'n_tokens_neox': 477, 'n_words': 104}