<?php

namespace App\Entity;

use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\ExecutionContext;
use Doctrine\Common\Collections\ArrayCollection;
use JMS\Serializer\Annotation\ExclusionPolicy;
use JMS\Serializer\Annotation\Expose;
use JMS\Serializer\Annotation\Groups;
use JMS\Serializer\Annotation\VirtualProperty;


/**
 * @ORM\Table(name="category")
 * @ORM\Entity(repositoryClass="App\Entity\CategoryRepository")
 * @ORM\HasLifecycleCallbacks
 * @ExclusionPolicy("all")
 */
class Category
{
    /**
     * @ORM\Column(type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     * @Expose
     */
    protected $id;

   /**
     * @ORM\OneToMany(targetEntity="Category", mappedBy="parent")
     */
    private $children;

    /**
     * @ORM\ManyToOne(targetEntity="Category", inversedBy="children")
     * @ORM\JoinColumn(name="parent", referencedColumnName="id")
     * @Expose
     */
    private $parent;

    /**
     *
     * @ORM\Column(name="ordered", type="integer", nullable=true)
     */
    private $ordered;

    /**
     * @var string $name
     *
     * @ORM\Column(name="name", type="string", length=255)
     * @Expose
     */
    private $name;

    /**
     * @var string $type
     *
     * @ORM\Column(name="type", type="string", length=255, nullable=true)
     */
    private $type;

    /**
     * @var string $type
     *
     * @ORM\Column(name="type_seo", type="string", length=255, nullable=true)
     */
    private $typeSeo;

    /**
     * @Gedmo\Slug(fields={"name"})
     * @Doctrine\ORM\Mapping\Column(length=128, unique=true)
     */
    private $slug;


    /**
     * @var string $content
     *
     * @ORM\Column(name="content", type="text", nullable=true)
     */
    private $content;

    /**
     * @var string $name
     *
     * @ORM\Column(name="class_icon", type="string", length=255, nullable=true)
     */
    private $classIcon;

    /**
     * @var string $name
     *
     * @ORM\Column(name="ios_icon", type="string", length=255, nullable=true)
     * @Expose
     */
    private $iosIcon;

    /**
     * @var string $name
     *
     * @ORM\Column(name="background_img", type="string", length=255, nullable=true)
     */
    private $backgroundImg;

    /**
     * @var string $name
     *
     * @ORM\Column(name="color_text", type="string", length=255, nullable=true)
     */
    private $colorText;

    /**
     * @var string $name
     *
     * @ORM\Column(name="img_cover", type="string", length=255, nullable=true)
     */
    private $imgCover;

    /**
     * @var string $name
     *
     * @ORM\Column(name="text_position", type="string", length=255, nullable=true)
     */
    private $textPosition;

    /**
     * @var integer
     *
     * @ORM\Column(name="status", type="boolean", nullable=true)
     */
    private $status = false;


    public function __toString() 
    {
        return "categories";
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }
    /**
     * Constructor
     */
    public function __construct()
    {
        $this->children = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * 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;
    }

    /**
     * Set slug
     *
     * @param string $slug
     *
     * @return Category
     */
    public function setSlug($slug)
    {
        $this->slug = $slug;

        return $this;
    }

    /**
     * Get slug
     *
     * @return string
     */
    public function getSlug()
    {
        return $this->slug;
    }

    /**
     * Set status
     *
     * @param boolean $status
     *
     * @return Category
     */
    public function setStatus($status)
    {
        $this->status = $status;

        return $this;
    }

    /**
     * Get status
     *
     * @return boolean
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * Add child
     *
     * @param \App\Entity\Category $child
     *
     * @return Category
     */
    public function addChild(\App\Entity\Category $child)
    {
        $this->children[] = $child;

        return $this;
    }

    /**
     * Remove child
     *
     * @param \App\Entity\Category $child
     */
    public function removeChild(\App\Entity\Category $child)
    {
        $this->children->removeElement($child);
    }

    /**
     * Get children
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getChildren()
    {
        return $this->children;
    }

    /**
     * Set parent
     *
     * @param \App\Entity\Category $parent
     *
     * @return Category
     */
    public function setParent(\App\Entity\Category $parent = null)
    {
        $this->parent = $parent;

        return $this;
    }

    /**
     * Get parent
     *
     * @return \App\Entity\Category
     */
    public function getParent()
    {
        return $this->parent;
    }


    /**
     * Set classIcon
     *
     * @param string $classIcon
     *
     * @return Category
     */
    public function setClassIcon($classIcon)
    {
        $this->classIcon = $classIcon;

        return $this;
    }

    /**
     * Get classIcon
     *
     * @return string
     */
    public function getClassIcon()
    {
        return $this->classIcon;
    }

    /**
     * Set iosIcon
     *
     * @param string $iosIcon
     *
     * @return Category
     */
    public function setIosIcon($iosIcon)
    {
        $this->iosIcon = $iosIcon;

        return $this;
    }

    /**
     * Get iosIcon
     *
     * @return string
     */
    public function getIosIcon()
    {
        return $this->iosIcon;
    }

    /**
     * Set backgroundImg
     *
     * @param string $backgroundImg
     *
     * @return Category
     */
    public function setBackgroundImg($backgroundImg)
    {
        $this->backgroundImg = $backgroundImg;

        return $this;
    }

    /**
     * Get backgroundImg
     *
     * @return string
     */
    public function getBackgroundImg()
    {
        return $this->backgroundImg;
    }

    /**
     * Set colorText
     *
     * @param string $colorText
     *
     * @return Category
     */
    public function setColorText($colorText)
    {
        $this->colorText = $colorText;

        return $this;
    }

    /**
     * Get colorText
     *
     * @return string
     */
    public function getColorText()
    {
        return $this->colorText;
    }

    /**
     * Set content
     *
     * @param string $content
     *
     * @return Category
     */
    public function setContent($content)
    {
        $this->content = $content;

        return $this;
    }

    /**
     * Get content
     *
     * @return string
     */
    public function getContent()
    {
        return $this->content;
    }

    /**
     * Set imgCover
     *
     * @param string $imgCover
     *
     * @return Category
     */
    public function setImgCover($imgCover)
    {
        $this->imgCover = $imgCover;

        return $this;
    }

    /**
     * Get imgCover
     *
     * @return string
     */
    public function getImgCover()
    {
        return $this->imgCover;
    }

    /**
     * Set textPosition
     *
     * @param string $textPosition
     *
     * @return Category
     */
    public function setTextPosition($textPosition)
    {
        $this->textPosition = $textPosition;

        return $this;
    }

    /**
     * Get textPosition
     *
     * @return string
     */
    public function getTextPosition()
    {
        return $this->textPosition;
    }

    /**
     * Set type
     *
     * @param string $type
     *
     * @return Category
     */
    public function setType($type)
    {
        $this->type = $type;

        return $this;
    }

    /**
     * Get type
     *
     * @return string
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Set typeSeo
     *
     * @param string $typeSeo
     *
     * @return Category
     */
    public function setTypeSeo($typeSeo)
    {
        $this->typeSeo = $typeSeo;

        return $this;
    }

    /**
     * Get typeSeo
     *
     * @return string
     */
    public function getTypeSeo()
    {
        return $this->typeSeo;
    }
}
