<commit_before><?php

/**
 * @author <NAME> <<EMAIL>>
 * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
 */

namespace MaglBlog\Repository;

use Doctrine\ORM\EntityRepository;

/**
 * Description of Category
 *
 * @author matthias
 */
class TagRepository extends EntityRepository 
{

	public function findWithPostCount()
	{
		$em = $this->getEntityManager();
		$query = $em->createQuery('SELECT t as tag, count(p.id) as postCount FROM MaglBlog\Entity\Tag t JOIN t.blogPosts p GROUP BY t.id');
		$result = $query->getResult();
		return $result;
	}
	
	public function findOneByUrlPart($urlPart)
	{
		return $this->findOneBy(array('url_part' => $urlPart));
	}
}<commit_msg>ordering the tag cloud by tag name<commit_after><?php

/**
 * @author <NAME> <<EMAIL>>
 * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
 */

namespace MaglBlog\Repository;

use Doctrine\ORM\EntityRepository;

/**
 * Description of Category
 *
 * @author matthias
 */
class TagRepository extends EntityRepository 
{

	public function findWithPostCount()
	{
		$em = $this->getEntityManager();
		$query = $em->createQuery(
			'SELECT t as tag, count(p.id) as postCount'.
			' FROM MaglBlog\Entity\Tag t'.
			' JOIN t.blogPosts p'.
			' GROUP BY t.id'.
			' ORDER BY t.name'
		);
		$result = $query->getResult();
		return $result;
	}
	
	public function findOneByUrlPart($urlPart)
	{
		return $this->findOneBy(array('url_part' => $urlPart));
	}
}
{'fraction_non_alphanumeric': 0.15241379310344827, 'fraction_numerical': 0.002758620689655172, 'mean_word_length': 4.003448275862069, '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': '6876264', 'n_tokens_mistral': 535, 'n_tokens_neox': 496, 'n_words': 114}