<commit_before><?php

namespace WSAD\JobsBundle\Entity;

use Doctrine\ORM\EntityRepository;

/**
 * CategoryRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class CategoryRepository extends EntityRepository
{
	public function getContainingJobs()
	{
		$dql = 'SELECT c FROM '.$this->_entityName.' c LEFT JOIN c.jobs j '
			  .'WHERE j.expires_at > ?1 AND j.is_activated = ?2';
	    $query = $this->_em->createQuery($dql);
	    $query->setParameters(array(1 => new \DateTime, 2 => true));
    	return $query->getResult();					
	}
	
	public function getCategoriesWithJobs($limit)
	{
		$categories = $this->getContainingJobs();
		$jobsRepository = $this->_em->getRepository('JobsBundle:Job');
		foreach($categories as $c) {
			$c->setActiveJobs($jobsRepository->getJobsByCategory($c->getId(), $limit));
		}
		return $categories;
	}
}<commit_msg>Reformat repository sourcecode<commit_after><?php

namespace WSAD\JobsBundle\Entity;

use Doctrine\ORM\EntityRepository;

/**
 * CategoryRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class CategoryRepository extends EntityRepository
{
	public function getContainingJobs()
	{
		$dql = 'SELECT c FROM '.$this->_entityName.' c LEFT JOIN c.jobs j '
			  .'WHERE j.expires_at > ?1 AND j.is_activated = ?2';
		
	    $query = $this->_em->createQuery($dql);
	    $query->setParameters(array(1 => new \DateTime, 2 => true));
	    
    	return $query->getResult();					
	}
	
	public function getCategoriesWithJobs($limit)
	{
		$categories = $this->getContainingJobs();
		$jobsRepository = $this->_em->getRepository('JobsBundle:Job');
		
		foreach($categories as $c) {
			$c->setActiveJobs($jobsRepository->getJobsByCategory($c->getId(), $limit));
		}
		
		return $categories;
	}
}
{'fraction_non_alphanumeric': 0.14393939393939395, 'fraction_numerical': 0.004329004329004329, 'mean_word_length': 4.136111111111111, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, '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': '6882185', 'n_tokens_mistral': 647, 'n_tokens_neox': 579, 'n_words': 136}