<commit_before><?php
/**
 * Created by PhpStorm.
 * User: claudio
 * Date: 20-01-16
 * Time: 19:17
 */

namespace AscensoDigital\PerfilBundle\Model;


use Doctrine\ORM\EntityManager;

class PerfilManager
{
    protected $class;
    protected $repository;

    /**
     * Constructor.
     *
     * @param EntityManager  $em
     * @param string         $class
     */
    public function __construct(EntityManager $em, $class) {

        $this->repository = $em->getRepository($class);

        $metadata = $em->getClassMetadata($class);
        $this->class = $metadata->getName();
    }

    public function find($id) {
        return $this->repository->find($id);
    }

    public function findPerfilBy(array $criteria) {
        return $this->repository->findOneBy($criteria);
    }

    public function findPerfils() {
        return $this->repository->findAll();
    }

    public function getClass() {
        return $this->class;
    }
}<commit_msg>se agrega metodo requerido para administracion de permisos<commit_after><?php
/**
 * Created by PhpStorm.
 * User: claudio
 * Date: 20-01-16
 * Time: 19:17
 */

namespace AscensoDigital\PerfilBundle\Model;


use Doctrine\ORM\EntityManager;

class PerfilManager
{
    protected $class;
    protected $repository;

    /**
     * Constructor.
     *
     * @param EntityManager  $em
     * @param string         $class
     */
    public function __construct(EntityManager $em, $class) {

        $this->repository = $em->getRepository($class);

        $metadata = $em->getClassMetadata($class);
        $this->class = $metadata->getName();
    }

    public function find($id) {
        return $this->repository->find($id);
    }

    public function findAllOrderRole() {
        return $this->repository->findAllOrderRole();
    }
    
    public function findPerfilBy(array $criteria) {
        return $this->repository->findOneBy($criteria);
    }

    public function findPerfils() {
        return $this->repository->findAll();
    }

    public function getClass() {
        return $this->class;
    }
}
{'fraction_non_alphanumeric': 0.13352685050798258, 'fraction_numerical': 0.009675858732462506, 'mean_word_length': 2.6153846153846154, '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': '4001955', 'n_tokens_mistral': 642, 'n_tokens_neox': 612, 'n_words': 130}