<commit_before><?php

namespace Spolischook\RealEstateBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;

/**
 * Category
 *
 * @ORM\Table(name="category")
 * @ORM\Entity
 */
class Category
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="name", type="string", length=255)
     */
    private $name;

    /** @ORM\OneToMany(targetEntity="TypeEstate", mappedBy="category") */
    private $types;

    /** @ORM\ManyToMany(targetEntity="Category", mappedBy="parents") */
    private $children;

    /**
     * @ORM\ManyToMany(targetEntity="Category", inversedBy="children")
     * @ORM\JoinTable(name="category_category",
     *      joinColumns={@ORM\JoinColumn(name="child_id", referencedColumnName="id")},
     *      inverseJoinColumns={@ORM\JoinColumn(name="parent_id", referencedColumnName="id")}
     *      )
     */
    private $parents;

    public function __construct() {
        $this->types = new ArrayCollection();
        $this->children = new ArrayCollection();
        $this->parents = new ArrayCollection();
    }


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

    /**
     * Set name
     *
     * @param string $name
     * @return Category
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

    /**
     * Get name
     *
     * @return string 
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Add types
     *
     * @param \Spolischook\RealEstateBundle\Entity\TypeEstate $types
     * @return Category
     */
    public function addType(\Spolischook\RealEstateBundle\Entity\TypeEstate $types)
    {
        $this->types[] = $types;

        return $this;
    }

    /**
     * Remove types
     *
     * @param \Spolischook\RealEstateBundle\Entity\TypeEstate $types
     */
    public function removeType(\Spolischook\RealEstateBundle\Entity\TypeEstate $types)
    {
        $this->types->removeElement($types);
    }

    /**
     * Get types
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getTypes()
    {
        return $this->types;
    }

    /**
     * Add children
     *
     * @param Category $child
     * @return Category
     */
    public function addChild(Category $child)
    {
        $this->children[] = $child;

        return $this;
    }

    /**
     * Remove children
     *
     * @param Category $children
     */
    public function removeChild(Category $children)
    {
        $this->children->removeElement($children);
    }

    /**
     * Get children
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getChildren()
    {
        return $this->children;
    }

    /**
     * Add parents
     *
     * @param Category $parent
     * @return Category
     */
    public function addParent(Category $parent)
    {
        $this->parents[] = $parent;
        $parent->addChild($this);

        return $this;
    }

    /**
     * Remove parents
     *
     * @param Category $parent
     */
    public function removeParent(Category $parent)
    {
        $this->parents->removeElement($parent);
    }

    /**
     * Get parents
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getParents()
    {
        return $this->parents;
    }

    public function __toString()
    {
        return $this->name ? $this->name : 'category';<commit_msg>Edit Category entity<commit_after><?php

namespace Spolischook\RealEstateBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;

/**
 * Category
 *
 * @ORM\Table(name="category")
 * @ORM\Entity
 */
class Category
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="name", type="string", length=255)
     */
    private $name;

    /** @ORM\OneToMany(targetEntity="TypeEstate", mappedBy="category") */
    private $types;

    /** @ORM\OneToMany(targetEntity="Category", mappedBy="parent") */
    private $children;

    /**
     * @ORM\ManyToOne(targetEntity="Category", inversedBy="children")
     * @ORM\JoinColumn(name="parent_id", referencedColumnName="id")
     */
    private $parent;

    public function __construct() {
        $this->types = new ArrayCollection();
        $this->children = new ArrayCollection();
        $this->parents = new ArrayCollection();
    }

    public function __toString()
    {
        return $this->name ? $this->name : 'category';
    }

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

    /**
     * Set name
     *
     * @param string $name
     * @return Category
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

    /**
     * Get name
     *
     * @return string 
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Add types
     *
     * @param \Spolischook\RealEstateBundle\Entity\TypeEstate $types
     * @return Category
     */
    public function addType(\Spolischook\RealEstateBundle\Entity\TypeEstate $types)
    {
        $this->types[] = $types;

        return $this;
    }

    /**
     * Remove types
     *
     * @param \Spolischook\RealEstateBundle\Entity\TypeEstate $types
     */
    public function removeType(\Spolischook\RealEstateBundle\Entity\TypeEstate $types)
    {
        $this->types->removeElement($types);
    }

    /**
     * Get types
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getTypes()
    {
        return $this->types;
    }

    /**
     * Add children
     *
     * @param \Spolischook\RealEstateBundle\Entity\Category $children
     * @return Category
     */
    public function addChild(\Spolischook\RealEstateBundle\Entity\Category $children)
    {
        $this->children[] = $children;

        return $this;
    }

    /**
     * Remove children
     *
     * @param \Spolischook\RealEstateBundle\Entity\Category $children
     */
    public function removeChild(\Spolischook\RealEstateBundle\Entity\Category $children)
    {
        $this->children->removeElement($children);
    }

    /**
     * Get children
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getChildren()
    {
        return $this->children;
    }

    /**
     * Set parent
     *
     * @param \Spolischook\RealEstateBundle\Entity\Category $parent
     * @return Category
     */
    public function setParent(\Spolischook\RealEstateBundle\Entity\Category $parent = null)
    {
        $this->parent = $parent;
        $parent == null ?:$parent->addChild($this);

        return $this;
    }

    /**
     * Get parent
     *
     * @return \Spolischook\RealEstateBundle\Entity\Category 
     */
    public function getParent()
    {
        return $this->parent;
{'fraction_non_alphanumeric': 0.13922155688622753, 'fraction_numerical': 0.0008165487207403375, 'mean_word_length': 2.0519102990033224, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 43, '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': '4038451', 'n_tokens_mistral': 2265, 'n_tokens_neox': 2204, 'n_words': 391}