<commit_before><?php
/**
 * Schema Class for output data.
 */
namespace Graviton\AnalyticsBundle\Model;

use Graviton\DocumentBundle\Service\DateConverter;
use Rs\Json\Patch;
use Symfony\Component\Serializer\Exception\InvalidArgumentException;

/**
 * Schema
 *
 * @author   List of contributors <https://github.com/libgraviton/graviton/graphs/contributors>
 * @license  https://opensource.org/licenses/MIT MIT License
 * @link     http://swisscom.ch
 */
class AnalyticModel
{
    /**
     * @var DateConverter
     */
    protected $dateConverter;

    protected $collection;
    protected $route;
    protected $aggregate = [];
    protected $schema;
    protected $type;
    protected $cacheTime;
    protected $params = [];
    protected $multiPipeline = false;
    protected $processor;

    /**
     * set DateConverter
     *
     * @param DateConverter $dateConverter dateConverter
     *
     * @return void
     */
    public function setDateConverter($dateConverter)
    {
        $this->dateConverter = $dateConverter;
    }

    /**
     * String collection
     *
     * @param string $pipelineName which pipeline you want the collection for
     *
     * @return string collection name
     */
    public function getCollection($pipelineName = null)
    {
        if (!is_object($this->collection)) {
            return $this->collection;
        }

        if ($pipelineName == null) {
            throw new \LogicException(
                'If you specify multiple collections in your analytics definition, '.<commit_msg>allow to set database name in analytics spec<commit_after><?php
/**
 * Schema Class for output data.
 */
namespace Graviton\AnalyticsBundle\Model;

use Graviton\DocumentBundle\Service\DateConverter;
use Rs\Json\Patch;
use Symfony\Component\Serializer\Exception\InvalidArgumentException;

/**
 * Schema
 *
 * @author   List of contributors <https://github.com/libgraviton/graviton/graphs/contributors>
 * @license  https://opensource.org/licenses/MIT MIT License
 * @link     http://swisscom.ch
 */
class AnalyticModel
{
    /**
     * @var DateConverter
     */
    protected $dateConverter;

    protected $database;
    protected $collection;
    protected $route;
    protected $aggregate = [];
    protected $schema;
    protected $type;
    protected $cacheTime;
    protected $params = [];
    protected $multiPipeline = false;
    protected $processor;

    /**
     * set DateConverter
     *
     * @param DateConverter $dateConverter dateConverter
     *
     * @return void
     */
    public function setDateConverter($dateConverter)
    {
        $this->dateConverter = $dateConverter;
    }

    /**
     * get Database
     *
     * @param string $pipelineName which pipeline you want the database for
     *
     * @return string database name name
     */
    public function getDatabase($pipelineName = null)
    {
        if (!is_object($this->database)) {
            return $this->database;
        }

        if (isset($this->database->$pipelineName)) {
            return $this->database->$pipelineName;
        }

        return null;
    }

    /**
     * set Database
     *
     * @param mixed $database database
     *
     * @return void
     */
    public function setDatabase($database)
    {
        $this->database = $database;
    }

    /**
     * String collection
     *
     * @param string $pipelineName which pipeline you want the collection for
     *
     * @return string collection name
     */
    public function getCollection($pipelineName = null)
    {
        if (!is_object($this->collection)) {
            return $this->collection;
        }

        if ($pipelineName == null) {
            throw new \LogicException(
                'If you specify multiple collections in your analytics definition, '.
{'fraction_non_alphanumeric': 0.10674749604638903, 'fraction_numerical': 0.0, 'mean_word_length': 2.434389140271493, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 18, 'https://': 4, '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': '1558106', 'n_tokens_mistral': 1026, 'n_tokens_neox': 1001, 'n_words': 259}