Guest User

Untitled

a guest
Sep 30th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.69 KB | None | 0 0
  1. <?php
  2. namespace Backend\Modules\Asaf\Domain\Categorys;
  3.  
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Backend\Core\Engine\Authentication;
  6. use Common\Doctrine\Entity\Meta;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\Common\Collections\Collection;
  9. // * Class Product
  10. // * @package Backend\Modules\AsafDomain\Category
  11.  
  12. /**
  13. *
  14. * @ORM\Table(name="asaf_category")
  15. * @ORM\Entity(repositoryClass="Backend\Modules\Asaf\Domain\Categorys\CategoryRepository")
  16. */
  17.  
  18. class Category
  19. {
  20. /**
  21. * @var integer
  22. *
  23. * @ORM\Column(type="integer")
  24. * @ORM\Id()
  25. * @ORM\GeneratedValue()
  26. */
  27. private $id = 0;
  28.  
  29. /**
  30. * @var string
  31. *
  32. * @ORM\Column(type="string", name="title")
  33. */
  34. private $title;
  35.  
  36. /**
  37. * @var string
  38. *
  39. * @ORM\Column(type="string", name="path", nullable=true)
  40. */
  41. private $path;
  42.  
  43.  
  44. /**
  45. * @var integer
  46. *
  47. * @ORM\Column(type="integer", name="parent", nullable=true)
  48. */
  49. private $parent;
  50.  
  51. /**
  52. * @var string
  53. *
  54. * @ORM\Column(type="text", nullable=true)
  55. */
  56. private $description = '';
  57.  
  58.  
  59. /**
  60. * @var boolean
  61. *
  62. * @ORM\Column(type="boolean", options={"default" = false})
  63. */
  64. private $active = false;
  65.  
  66.  
  67. /**
  68. * @var string
  69. *
  70. * @ORM\Column(type="string", length=255)
  71. */
  72. private $image = '';
  73.  
  74. /**
  75. * @ORM\OneToMany(targetEntity="Backend\Modules\Asaf\Domain\Products\Product", inversedBy="category")
  76. */
  77. private $product;
  78.  
  79. /**
  80. * @var string
  81. *
  82. * @ORM\Column(type="string", name="main_category")
  83. */
  84. private $maincategory;
  85.  
  86.  
  87. /**
  88. * @return int
  89. */
  90. public function getId(): int
  91. {
  92. return $this->id;
  93. }
  94.  
  95. public function setId($id): int
  96. {
  97. return $this->id = $id;
  98. }
  99.  
  100. /**
  101. * @return bool
  102. */
  103. public function isActive(): bool
  104. {
  105. return $this->active;
  106. }
  107.  
  108. /**
  109. * @param bool $active
  110. */
  111. public function setActive(bool $active): void
  112. {
  113. $this->active = $active;
  114. }
  115.  
  116. /**
  117. * @return string
  118. */
  119. public function getTitle()
  120. {
  121. return (string)$this->title;
  122. }
  123.  
  124. /**
  125. * @param string $title
  126. */
  127. public function setTitle(string $title): void
  128. {
  129. $this->title = $title;
  130. }
  131.  
  132. /**
  133. * @return string
  134. */
  135. public function getDescription()
  136. {
  137. return (string)$this->description;
  138. }
  139.  
  140. /**
  141. * @param string $description
  142. */
  143. public function setDescription(string $description): void
  144. {
  145. $this->description = $description;
  146. }
  147.  
  148.  
  149. /**
  150. * @return string
  151. */
  152. public function getImage(): string
  153. {
  154. return $this->image;
  155. }
  156.  
  157. /**
  158. * @param string $image
  159. */
  160. //public function setImage(string $image): void
  161. public function setImage($image): void
  162. {
  163. if(!$image){
  164. $image = '';
  165. }
  166. $this->image = $image;
  167. }
  168.  
  169.  
  170. /**
  171. * @return string
  172. */
  173. public function getMainCategory()
  174. {
  175. return (string)$this->maincategory;
  176. }
  177.  
  178. /**
  179. * @param string $maincategory
  180. */
  181. public function setMainCategory(string $maincategory): void
  182. {
  183. $this->maincategory = $maincategory;
  184. }
  185.  
  186. /**
  187. * @return Collection
  188. */
  189. public function getProduct()
  190. {
  191. return $this->product;
  192. }
  193. /**
  194. * @param Collection $product
  195. */
  196. public function setProduct(Collection $product): void
  197. {
  198. $this->product = $product;
  199. }
  200. }
Add Comment
Please, Sign In to add comment