<commit_before><?php

namespace Inowas\ScenarioAnalysisBundle\Model;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use FOS\UserBundle\Model\UserInterface;
use Inowas\ModflowBundle\Model\ModflowModel;
use Ramsey\Uuid\Uuid;

class ScenarioAnalysis
{
    /**
     * @var Uuid
     */
    protected $id;

    /**
     * @var Uuid
     */
    protected $userId;

    /**
     * @var Uuid
     */
    protected $baseModelId;

    /**
     * @var ArrayCollection
     */
    protected $scenarios;

    /**
     * ScenarioAnalysis constructor.
     * @param UserInterface $user
     * @param ModflowModel $model
     */
    public function __construct(UserInterface $user, ModflowModel $model)
    {
        $this->baseModelId = $model->getId();
        $this->userId = $user->getId();
        $this->id = Uuid::uuid4();
    }

    /**
     * @return Uuid
     */
    public function getId(): Uuid
    {
        return $this->id;
    }

    /**
     * @param Uuid $id
     * @return ScenarioAnalysis
     */
    public function setId(Uuid $id): ScenarioAnalysis
    {
        $this->id = $id;
        return $this;
    }

    /**
     * @return Uuid
     */
    public function getUserId(): Uuid
    {
        return $this->userId;
    }

    /**
     * @param Uuid $userId
     * @return ScenarioAnalysis
     */
    public function setUserId(Uuid $userId): ScenarioAnalysis
    {
        $this->userId = $userId;
        return $this;
    }

    /**
     * @return Uuid
     */
    public function getBaseModelId(): Uuid
    {
        return $this->baseModelId;
    }

    /**
     * @param Uuid $baseModelId
     * @return ScenarioAnalysis
     */
    public function setBaseModelId(Uuid $baseModelId): ScenarioAnalysis
    {
        $this->baseModelId = $baseModelId;
        return $this;
    }

    /**
     * @return Collection
     */
    public function getScenarios(): Collection
    {
        return $this->scenarios;
    }

    /**
     * @param ArrayCollection $scenarios
     * @return ScenarioAnalysis
     */
    public function setScenarios(ArrayCollection $scenarios): ScenarioAnalysis
    {
        $this->scenarios = $scenarios;
        return $this;
    }

    /**
     * @param Scenario $scenario
     * @return $this
     */
    public function addScenario(Scenario $scenario){
        $this->scenarios[] = $scenario;
        return $this;
    }

    /**
     * @param Scenario $scenario
     * @return $this
     */
    public function removeScenario(Scenario $scenario){
        if ($this->scenarios->contains($scenario)){
            $this->scenarios->removeElement($scenario);
        }
        return $this;
    }
}<commit_msg>Add delete scenario functionality<commit_after><?php

namespace Inowas\ScenarioAnalysisBundle\Model;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use FOS\UserBundle\Model\UserInterface;
use Inowas\ModflowBundle\Model\ModflowModel;
use Ramsey\Uuid\Uuid;

class ScenarioAnalysis
{
    /**
     * @var Uuid
     */
    protected $id;

    /**
     * @var Uuid
     */
    protected $userId;

    /**
     * @var Uuid
     */
    protected $baseModelId;

    /**
     * @var ArrayCollection
     */
    protected $scenarios;

    /**
     * ScenarioAnalysis constructor.
     * @param UserInterface $user
     * @param ModflowModel $model
     */
    public function __construct(UserInterface $user, ModflowModel $model)
    {
        $this->baseModelId = $model->getId();
        $this->userId = $user->getId();
        $this->id = Uuid::uuid4();
    }

    /**
     * @return Uuid
     */
    public function getId(): Uuid
    {
        return $this->id;
    }

    /**
     * @param Uuid $id
     * @return ScenarioAnalysis
     */
    public function setId(Uuid $id): ScenarioAnalysis
    {
        $this->id = $id;
        return $this;
    }

    /**
     * @return Uuid
     */
    public function getUserId(): Uuid
    {
        return $this->userId;
    }

    /**
     * @param Uuid $userId
     * @return ScenarioAnalysis
     */
    public function setUserId(Uuid $userId): ScenarioAnalysis
    {
        $this->userId = $userId;
        return $this;
    }

    /**
     * @return Uuid
     */
    public function getBaseModelId(): Uuid
    {
        return $this->baseModelId;
    }

    /**
     * @param Uuid $baseModelId
     * @return ScenarioAnalysis
     */
    public function setBaseModelId(Uuid $baseModelId): ScenarioAnalysis
    {
        $this->baseModelId = $baseModelId;
        return $this;
    }

    /**
     * @return Collection
     */
    public function getScenarios(): Collection
    {
        return $this->scenarios;
    }

    /**
     * @param ArrayCollection $scenarios
     * @return ScenarioAnalysis
     */
    public function setScenarios(ArrayCollection $scenarios): ScenarioAnalysis
    {
        $this->scenarios = $scenarios;
        return $this;
    }

    /**
     * @param Scenario $scenario
     * @return $this
     */
    public function addScenario(Scenario $scenario){
        $this->scenarios[] = $scenario;
        return $this;
    }

    /**
     * @param Scenario $scenario
     * @return $this
     */
    public function removeScenario(Scenario $scenario){
        if ($this->scenarios->contains($scenario)){
            $this->scenarios->removeElement($scenario);
        }

        $this->scenarios = new ArrayCollection($this->scenarios->toArray());
        return $this;
    }
}
{'fraction_non_alphanumeric': 0.1260932944606414, 'fraction_numerical': 0.00036443148688046647, 'mean_word_length': 2.039313399778516, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 42, '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': '4370292', 'n_tokens_mistral': 1699, 'n_tokens_neox': 1690, 'n_words': 338}