<commit_before><?php

namespace PHPOrchestra\ModelBundle\Repository;

use Doctrine\ODM\MongoDB\DocumentRepository;

/**
 * Class ContentTypeRepository
 */
class ContentTypeRepository extends DocumentRepository
{

}
<commit_msg>Get contentType on last version<commit_after><?php

namespace PHPOrchestra\ModelBundle\Repository;

use Doctrine\ODM\MongoDB\DocumentRepository;

/**
 * Class ContentTypeRepository
 */
class ContentTypeRepository extends DocumentRepository
{
    public function findInLastVersionByContentType($contentType)
    {
        $qb = $this->createQueryBuilder('n');
        $qb->field('contentTypeId')->equals($contentType);
        $qb->sort('version', 'desc');

        return $qb->getQuery()->getSingleResult();
    }
}

{'fraction_non_alphanumeric': 0.11978465679676985, 'fraction_numerical': 0.0, 'mean_word_length': 4.904761904761905, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '407380', 'n_tokens_mistral': 210, 'n_tokens_neox': 212, 'n_words': 36}