<commit_before><?php

namespace LoopAnime\CommentsBundle\Entity;

use Doctrine\ORM\EntityRepository;
use LoopAnime\ShowsBundle\Entity\AnimesEpisodes;
use LoopAnime\UsersBundle\Entity\Users;

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

    public function getCommentsByEpisode(AnimesEpisodes $episode, $getResults = true)
    {

        $idEpisode = $episode->getId();

        $query = $this->createQueryBuilder("comments")
                    ->select("comments")
                    ->addSelect('u')
                    ->join('comments.user','u')
                    ->where("comments.idEpisode = :idEpisode")
                    ->setParameter("idEpisode", $idEpisode)
                    ->getQuery();

        if($getResults) {
            return $query->getResult();
        } else {
            return $query;
        }

    }

    public function getCommentsByUser(Users $user, $getResults = true)
    {
        $idUser = $user->getId();

        $query = $this->createQueryBuilder("comments")
                    ->select("comments")
                    ->where("comments.idUser = :idUser")
                    ->setParameter("idUser", $idUser)
                    ->getQuery();
        if($getResults) {
            return $query->getResult();
        } else {
            return $query;
        }
    }

}
<commit_msg>Fixed problem with the listing of comments on user Profile<commit_after><?php

namespace LoopAnime\CommentsBundle\Entity;

use Doctrine\ORM\EntityRepository;
use LoopAnime\ShowsBundle\Entity\AnimesEpisodes;
use LoopAnime\UsersBundle\Entity\Users;

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

    public function getCommentsByEpisode(AnimesEpisodes $episode, $getResults = true)
    {

        $idEpisode = $episode->getId();

        $query = $this->createQueryBuilder("comments")
                    ->select("comments")
                    ->addSelect('u')
                    ->join('comments.user','u')
                    ->where("comments.idEpisode = :idEpisode")
                    ->setParameter("idEpisode", $idEpisode)
                    ->getQuery();

        if($getResults) {
            return $query->getResult();
        } else {
            return $query;
        }

    }

    public function getCommentsByUser(Users $user, $getResults = true)
    {
        $idUser = $user->getId();

        $query = $this->createQueryBuilder("comments")
                    ->select("comments")
                    ->where("comments.user = :user")
                    ->setParameter("user", $user)
                    ->getQuery();
        if($getResults) {
            return $query->getResult();
        } else {
            return $query;
        }
    }

}

{'fraction_non_alphanumeric': 0.12361437688948607, 'fraction_numerical': 0.0, 'mean_word_length': 1.925343811394892, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2766252', 'n_tokens_mistral': 822, 'n_tokens_neox': 777, 'n_words': 159}