<commit_before><?php
namespace OpenOrchestra\UserBundle\DomainManager;

use Doctrine\Common\Persistence\ObjectManager;
use OpenOrchestra\UserBundle\Document\ApiClient;

/**
 * Class ApiClientMananger
 */
class ApiClientManager
{
    /**
     * @var ObjectManager
     */
    private $om;

    /**
     * @var string
     */
    private $class;

    /**
     * @param ObjectManager $manager
     * @param string        $class
     */
    public function __construct(ObjectManager $manager, $class)
    {
        $this->om = $manager;
        $this->class = $class;
    }

    /**
     * Create a fresh object
     */
    public function create()
    {
        $apiClientClass = $this->class;
        return new $apiClientClass();
    }
    /**
     * @param ApiClient $apiClient
     */
    public function save(ApiClient $apiClient)
    {
        $this->om->persist($apiClient);
        $this->om->flush();
    }

    /**
     * @param ApiClient $apiClient
     */
    public function delete(ApiClient $apiClient)
    {
        $this->om->remove($apiClient);
        $this->om->flush();
    }
}<commit_msg>load method in apiclient domain manager<commit_after><?php
namespace OpenOrchestra\UserBundle\DomainManager;

use Doctrine\Common\Persistence\ObjectManager;
use OpenOrchestra\UserBundle\Document\ApiClient;

/**
 * Class ApiClientMananger
 */
class ApiClientManager
{
    /**
     * @var ObjectManager
     */
    private $om;

    /**
     * @var string
     */
    private $class;

    /**
     * @param ObjectManager $manager
     * @param string        $class
     */
    public function __construct(ObjectManager $manager, $class)
    {
        $this->om = $manager;
        $this->class = $class;
    }

    /**
     * Create a fresh object
     */
    public function create()
    {
        $apiClientClass = $this->class;
        return new $apiClientClass();
    }

    /**
     * @param int $id
     *
     * @return ApiClient
     */
    public function load($id)
    {
        $repository = $this->om->getRepository($this->class);

        return $repository->find($id);
    }
    /**
     * @param ApiClient $apiClient
     */
    public function save(ApiClient $apiClient)
    {
        $this->om->persist($apiClient);
        $this->om->flush();
    }

    /**
     * @param ApiClient $apiClient
     */
    public function delete(ApiClient $apiClient)
    {
        $this->om->remove($apiClient);
        $this->om->flush();
    }
}
{'fraction_non_alphanumeric': 0.13860578883000407, 'fraction_numerical': 0.0, 'mean_word_length': 2.0829145728643215, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, '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': '6097958', 'n_tokens_mistral': 741, 'n_tokens_neox': 745, 'n_words': 145}