<commit_before><?php

namespace App\Entity;

use App\Doctrine\EntityRepository;

class PropertyRepository extends EntityRepository
{
    protected $fieldSearchWhitelist = array();
    public function create($object) {
        $this->getEntityManager()->beginTransaction();
        parent::create($object);
        $users = $this->getEntityManager()
                ->createQueryBuilder()
                ->select('partial u.{id}')
                ->from('AppBundle:User', 'u')
                ->getQuery()
                ->setHint(\Doctrine\ORM\Query::HINT_FORCE_PARTIAL_LOAD, 1)
                ->getResult();
        $userProperties = array();
        foreach($users as $user) {
            $this->getEntityManager()->persist($userProperties[] = new UserProperty($user, $object));
        }
        $this->getEntityManager()->flush($userProperties);
        $this->getEntityManager()->commit();
    }
}
<commit_msg>Add search for name to PropertyRepository<commit_after><?php

namespace App\Entity;

use App\Doctrine\EntityRepository;
use vierbergenlars\Bundle\RadRestBundle\Doctrine\QueryBuilderPageDescription;

class PropertyRepository extends EntityRepository
{
    public function create($object) {
        $this->getEntityManager()->beginTransaction();
        parent::create($object);
        $users = $this->getEntityManager()
                ->createQueryBuilder()
                ->select('partial u.{id}')
                ->from('AppBundle:User', 'u')
                ->getQuery()
                ->setHint(\Doctrine\ORM\Query::HINT_FORCE_PARTIAL_LOAD, 1)
                ->getResult();
        $userProperties = array();
        foreach($users as $user) {
            $this->getEntityManager()->persist($userProperties[] = new UserProperty($user, $object));
        }
        $this->getEntityManager()->flush($userProperties);
        $this->getEntityManager()->commit();
    }
    
    public function search($terms)
    {
        $name = str_replace('*', '%', $terms);
        return new QueryBuilderPageDescription($this->createQueryBuilder('e')->where('e.name LIKE :name')->setParameter('name', '%'.$name.'%'));
    }
}

{'fraction_non_alphanumeric': 0.15381019167835436, 'fraction_numerical': 0.0009350163627863488, 'mean_word_length': 2.7217391304347824, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 36, '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': '5884468', 'n_tokens_mistral': 579, 'n_tokens_neox': 562, 'n_words': 94}