Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Backend\Modules\Asaf\Domain\Categorys;
- use Doctrine\ORM\Mapping as ORM;
- use Backend\Core\Engine\Authentication;
- use Common\Doctrine\Entity\Meta;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\Common\Collections\Collection;
- // * Class Product
- // * @package Backend\Modules\AsafDomain\Category
- /**
- *
- * @ORM\Table(name="asaf_category")
- * @ORM\Entity(repositoryClass="Backend\Modules\Asaf\Domain\Categorys\CategoryRepository")
- */
- class Category
- {
- /**
- * @var integer
- *
- * @ORM\Column(type="integer")
- * @ORM\Id()
- * @ORM\GeneratedValue()
- */
- private $id = 0;
- /**
- * @var string
- *
- * @ORM\Column(type="string", name="title")
- */
- private $title;
- /**
- * @var string
- *
- * @ORM\Column(type="string", name="path", nullable=true)
- */
- private $path;
- /**
- * @var integer
- *
- * @ORM\Column(type="integer", name="parent", nullable=true)
- */
- private $parent;
- /**
- * @var string
- *
- * @ORM\Column(type="text", nullable=true)
- */
- private $description = '';
- /**
- * @var boolean
- *
- * @ORM\Column(type="boolean", options={"default" = false})
- */
- private $active = false;
- /**
- * @var string
- *
- * @ORM\Column(type="string", length=255)
- */
- private $image = '';
- /**
- * @ORM\OneToMany(targetEntity="Backend\Modules\Asaf\Domain\Products\Product", inversedBy="category")
- */
- private $product;
- /**
- * @var string
- *
- * @ORM\Column(type="string", name="main_category")
- */
- private $maincategory;
- /**
- * @return int
- */
- public function getId(): int
- {
- return $this->id;
- }
- public function setId($id): int
- {
- return $this->id = $id;
- }
- /**
- * @return bool
- */
- public function isActive(): bool
- {
- return $this->active;
- }
- /**
- * @param bool $active
- */
- public function setActive(bool $active): void
- {
- $this->active = $active;
- }
- /**
- * @return string
- */
- public function getTitle()
- {
- return (string)$this->title;
- }
- /**
- * @param string $title
- */
- public function setTitle(string $title): void
- {
- $this->title = $title;
- }
- /**
- * @return string
- */
- public function getDescription()
- {
- return (string)$this->description;
- }
- /**
- * @param string $description
- */
- public function setDescription(string $description): void
- {
- $this->description = $description;
- }
- /**
- * @return string
- */
- public function getImage(): string
- {
- return $this->image;
- }
- /**
- * @param string $image
- */
- //public function setImage(string $image): void
- public function setImage($image): void
- {
- if(!$image){
- $image = '';
- }
- $this->image = $image;
- }
- /**
- * @return string
- */
- public function getMainCategory()
- {
- return (string)$this->maincategory;
- }
- /**
- * @param string $maincategory
- */
- public function setMainCategory(string $maincategory): void
- {
- $this->maincategory = $maincategory;
- }
- /**
- * @return Collection
- */
- public function getProduct()
- {
- return $this->product;
- }
- /**
- * @param Collection $product
- */
- public function setProduct(Collection $product): void
- {
- $this->product = $product;
- }
- }
Add Comment
Please, Sign In to add comment