<commit_before><?php

use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;

class Controller_Orm_Doctrine extends Controller_Base
{
    private $em;

    public function setup()
    {
        $db = $this->get_db_params();
        
        $entitiesPaths = [__DIR__];
        $isDevMode = false;
        $config = Setup::createAnnotationMetadataConfiguration(
            $entitiesPaths, $isDevMode
        );
        $dbParams = [
            'driver'    => 'pdo_mysql',
            'host'      => $db['host'],
            'dbname'    => $db['dbname'],
            'user'      => $db['username'],
            'password'  => $db['password'],
            'charset'   => 'utf8',
        ];
        $this->em = EntityManager::create($dbParams, $config);
    }

    public function action_get_one($id = 1)
    {
        $timeStart = microtime(true);
        $memoryStart = memory_get_usage();
        
        $this->setup();
        
        $post = $this->em->getRepository('Blog\Entity\Post')
                ->findOneBy(['id' => $id]);
        
        echo $post->getTitle() . '<br>' . "\n";
        echo $post->getComments()->first()->getBody() . '<br>' . "\n";
        
        echo microtime(true) - $timeStart . " secs<br>\n";
        echo (memory_get_usage() - $memoryStart)/1024 . " KB\n";
    }<commit_msg>Fix $entitiesPaths<commit_after><?php

use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;

class Controller_Orm_Doctrine extends Controller_Base
{
    private $em;

    public function setup()
    {
        $db = $this->get_db_params();
        
        $entitiesPaths = [APPPATH . 'classes/model/doctrine'];
        $isDevMode = false;
        $config = Setup::createAnnotationMetadataConfiguration(
            $entitiesPaths, $isDevMode
        );
        $dbParams = [
            'driver'    => 'pdo_mysql',
            'host'      => $db['host'],
            'dbname'    => $db['dbname'],
            'user'      => $db['username'],
            'password'  => $db['password'],
            'charset'   => 'utf8',
        ];
        $this->em = EntityManager::create($dbParams, $config);
    }

    public function action_get_one($id = 1)
    {
        $timeStart = microtime(true);
        $memoryStart = memory_get_usage();
        
        $this->setup();
        
        $post = $this->em->getRepository('Blog\Entity\Post')
                ->findOneBy(['id' => $id]);
        
        echo $post->getTitle() . '<br>' . "\n";
        echo $post->getComments()->first()->getBody() . '<br>' . "\n";
        
        echo microtime(true) - $timeStart . " secs<br>\n";
        echo (memory_get_usage() - $memoryStart)/1024 . " KB\n";
    }
{'fraction_non_alphanumeric': 0.1696562032884903, 'fraction_numerical': 0.004484304932735426, 'mean_word_length': 1.9066232356134636, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 43, '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': '5207040', 'n_tokens_mistral': 834, 'n_tokens_neox': 817, 'n_words': 140}