<commit_before><?php

namespace Biopen\GeoDirectoryBundle\Document;

use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;

/**
 * Option
 *
 * @MongoDB\Document(repositoryClass="Biopen\GeoDirectoryBundle\Repository\OptionRepository")
 */
class Option
{
    /**
     * @var int
     *
     * @MongoDB\Id(strategy="INCREMENT") 
     */
    private $id;

    /**
     * @var string
     *
     * @MongoDB\Field(type="string")
     */
    private $name;

    /**
     * @var string
     *
     * @MongoDB\Field(type="string")
     */
    private $nameShort;

    /**
    * @MongoDB\ReferenceMany(targetDocument="Biopen\GeoDirectoryBundle\Document\Category", mappedBy="parent",cascade={"all"}, orphanRemoval="true", sort={"index"="ASC"})
    */
    private $subcategories; 

    /**
     * @MongoDB\ReferenceOne(targetDocument="Biopen\GeoDirectoryBundle\Document\Category", inversedBy="options")
     */
    public $parent;

    /**
     * @var int
     * @Gedmo\Mapping\Annotation\SortablePosition
     * @MongoDB\Field(type="int") 
     */
    private $index;

    /**
     * @var string
     *
     * @MongoDB\Field(type="string")
     */
    private $color;

    /**
     * @var string
     *
     * @MongoDB\Field(type="string")
     */
    private $softColor;

    /**
     * @var string
     *
     * @MongoDB\Field(type="string")
     */
    private $icon;

    /**
     * @var string
     *
     * @MongoDB\Field(type="string")
     */
    private $textHelper;

    /**
     * @var bool
     *
     * @MongoDB\Field(type="boolean")
     */
    private $useIconForMarker;

    /**
     * @var bool
     *
     * @MongoDB\Field(type="boolean")
     */
    private $useColorForMarker;

    /**
     * @var bool
     *
     * @MongoDB\Field(type="boolean")
     */
    private $displayOption = true;

    /**
     * @var bool
     *
     * @MongoDB\Field(type="boolean")
     */
    private $showExpanded = false;

     /**
     * @var bool
     *
     * @MongoDB\Field(type="boolean")
     * Only for main options
     */
    private $showOpenHours = false;

    /**
     * @var bool
     *
     * If Option is loaded by a fixture
     */
    private $isFixture = false;

    public function __construct()
    {
        $this->subcategories = new \Doctrine\Common\Collections\ArrayCollection();
    }

    public function __toString() 
    {
        return "(Option) " . $this->getName();
    }
    
    /**
     * Get id
     *
     * @return int_id $id
     */
    public function getId()
    {
        return $this->id;
    }

    public function setId() 
    { 
        return $this; 
    }

    /**
     * Set name<commit_msg>Adds getParentOption method<commit_after><?php

namespace Biopen\GeoDirectoryBundle\Document;

use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;

/**
 * Option
 *
 * @MongoDB\Document(repositoryClass="Biopen\GeoDirectoryBundle\Repository\OptionRepository")
 */
class Option
{
    /**
     * @var int
     *
     * @MongoDB\Id(strategy="INCREMENT") 
     */
    private $id;

    /**
     * @var string
     *
     * @MongoDB\Field(type="string")
     */
    private $name;

    /**
     * @var string
     *
     * @MongoDB\Field(type="string")
     */
    private $nameShort;

    /**
    * @MongoDB\ReferenceMany(targetDocument="Biopen\GeoDirectoryBundle\Document\Category", mappedBy="parent",cascade={"all"}, orphanRemoval="true", sort={"index"="ASC"})
    */
    private $subcategories; 

    /**
     * @MongoDB\ReferenceOne(targetDocument="Biopen\GeoDirectoryBundle\Document\Category", inversedBy="options")
     */
    public $parent;

    /**
     * @var int
     * @Gedmo\Mapping\Annotation\SortablePosition
     * @MongoDB\Field(type="int") 
     */
    private $index;

    /**
     * @var string
     *
     * @MongoDB\Field(type="string")
     */
    private $color;

    /**
     * @var string
     *
     * @MongoDB\Field(type="string")
     */
    private $softColor;

    /**
     * @var string
     *
     * @MongoDB\Field(type="string")
     */
    private $icon;

    /**
     * @var string
     *
     * @MongoDB\Field(type="string")
     */
    private $textHelper;

    /**
     * @var bool
     *
     * @MongoDB\Field(type="boolean")
     */
    private $useIconForMarker;

    /**
     * @var bool
     *
     * @MongoDB\Field(type="boolean")
     */
    private $useColorForMarker;

    /**
     * @var bool
     *
     * @MongoDB\Field(type="boolean")
     */
    private $displayOption = true;

    /**
     * @var bool
     *
     * @MongoDB\Field(type="boolean")
     */
    private $showExpanded = false;

     /**
     * @var bool
     *
     * @MongoDB\Field(type="boolean")
     * Only for main options
     */
    private $showOpenHours = false;

    /**
     * @var bool
     *
     * If Option is loaded by a fixture
     */
    private $isFixture = false;

    public function __construct()
    {
        $this->subcategories = new \Doctrine\Common\Collections\ArrayCollection();
    }

    public function __toString() 
    {
        return "(Option) " . $this->getName();
    }

    public function getParentOption()
    {
        if (!$this->parent) return null;
        return $this->parent->parent;
    }
    
    /**
     * Get id
     *
     * @return int_id $id
     */
    public function getId()
    {
        return $this->id;
    }

    public function setId() 
    { 
        return $this; 
    }

    /**
     * Set name
{'fraction_non_alphanumeric': 0.15343426883308714, 'fraction_numerical': 0.0, 'mean_word_length': 1.9312770562770563, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, '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': '1685246', 'n_tokens_mistral': 1816, 'n_tokens_neox': 1757, 'n_words': 280}