<commit_before><?php
namespace ChrisAndChris\Common\RowMapperBundle\Services\Model;

use ChrisAndChris\Common\RowMapperBundle\Exceptions\InvalidOptionException;
use ChrisAndChris\Common\RowMapperBundle\Services\Mapper\RowMapper;
use ChrisAndChris\Common\RowMapperBundle\Services\Mapper\RowMapperFactory;
use ChrisAndChris\Common\RowMapperBundle\Services\Pdo\PdoLayer;
use ChrisAndChris\Common\RowMapperBundle\Services\Query\Builder;
use ChrisAndChris\Common\RowMapperBundle\Services\Query\BuilderFactory;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;

/**
 * @name ModelDependencyProvider
 * @version    2.1.0
 * @lastChange v2.1.0
 * @since      v2.0.0
 * @package    RowMapperBundle
 * @author     ChrisAndChris
 * @link       https://github.com/chrisandchris
 */
class ModelDependencyProvider {

    /** @var PdoLayer the pdo class */
    private $pdo;
    /** @var RowMapper the row mapper factory */
    private $mapperFactory;
    /** @var ErrorHandler */
    private $errorHandler;
    /** @var ContainerInterface the container */
    private $container;
    /** @var BuilderFactory the builder factory */
    private $builderFactory;

    function __construct(
        \PDO $pdo,
        RowMapperFactory $mapperFactory,
        ErrorHandler $errorHandler,
        BuilderFactory $builderFactory,
        ContainerInterface $container = null,
        EventDispatcherInterface $eventDispatcher = null) {

        $this->pdo = $pdo;
        $this->mapperFactory = $mapperFactory;
        $this->errorHandler = $errorHandler;
        $this->builderFactory = $builderFactory;
        $this->container = $container;
        $this->eventDispatcher = $eventDispatcher;
    }

    /**
     * @return PdoLayer
     */
    public function getPdo() {
        return $this->pdo;
    }

    /**
     * @return RowMapper
     */
    public function getMapper() {
        return $this->mapperFactory->getMapper();
    }

    /**
     * @return ErrorHandler
     */
    public function getErrorHandler() {
        return $this->errorHandler;
    }

    /**
     * @return Builder
     */
    public function getBuilder() {
        return $this->builderFactory->createBuilder();
    }

    /**
     * Creates a new database event<commit_msg>added search result utility to dependency provider<commit_after><?php
namespace ChrisAndChris\Common\RowMapperBundle\Services\Model;

use ChrisAndChris\Common\RowMapperBundle\Exceptions\InvalidOptionException;
use ChrisAndChris\Common\RowMapperBundle\Services\Mapper\RowMapper;
use ChrisAndChris\Common\RowMapperBundle\Services\Mapper\RowMapperFactory;
use ChrisAndChris\Common\RowMapperBundle\Services\Model\Utilities\SearchResultUtility;
use ChrisAndChris\Common\RowMapperBundle\Services\Pdo\PdoLayer;
use ChrisAndChris\Common\RowMapperBundle\Services\Query\Builder;
use ChrisAndChris\Common\RowMapperBundle\Services\Query\BuilderFactory;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;

/**
 * @name ModelDependencyProvider
 * @version    2.1.0
 * @lastChange v2.1.0
 * @since      v2.0.0
 * @package    RowMapperBundle
 * @author     ChrisAndChris
 * @link       https://github.com/chrisandchris
 */
class ModelDependencyProvider {

    /** @var PdoLayer the pdo class */
    private $pdo;
    /** @var RowMapper the row mapper factory */
    private $mapperFactory;
    /** @var ErrorHandler */
    private $errorHandler;
    /** @var ContainerInterface the container */
    private $container;
    /** @var BuilderFactory the builder factory */
    private $builderFactory;

    function __construct(
        \PDO $pdo,
        RowMapperFactory $mapperFactory,
        ErrorHandler $errorHandler,
        BuilderFactory $builderFactory,
        ContainerInterface $container = null,
        EventDispatcherInterface $eventDispatcher = null) {

        $this->pdo = $pdo;
        $this->mapperFactory = $mapperFactory;
        $this->errorHandler = $errorHandler;
        $this->builderFactory = $builderFactory;
        $this->container = $container;
        $this->eventDispatcher = $eventDispatcher;
    }

    /**
     * @return PdoLayer
     */
    public function getPdo() {
        return $this->pdo;
    }

    /**
     * @return RowMapper
     */
    public function getMapper() {
        return $this->mapperFactory->getMapper();
    }

    /**
     * @return ErrorHandler
     */
    public function getErrorHandler() {
        return $this->errorHandler;
    }

    /**
     * @return Builder
     */
    public function getBuilder() {
        return $this->builderFactory->createBuilder();
    }

    /**
     * @return SearchResultUtility
     */
    public function getSearchResultUtility()
    {
        return $this->container->get('common_rowmapper.search.result_utility');
    }

    /**
     * Creates a new database event
{'fraction_non_alphanumeric': 0.10702208076387508, 'fraction_numerical': 0.003580664412174259, 'mean_word_length': 3.101141924959217, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, 'https://': 2, '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': '5329236', 'n_tokens_mistral': 1415, 'n_tokens_neox': 1372, 'n_words': 274}