src/Entity/Material.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\MaterialRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @ORM\Entity(repositoryClass=MaterialRepository::class)
  7. */
  8. class Material
  9. {
  10. const ADDED = 0;
  11. const INPROGRESS = 1;
  12. const INSTOCK = 2;
  13. const SOLD = 3;
  14. const LOCKED = 4;
  15. public static $statuses = [
  16. Material::ADDED=>'Rögzítve',
  17. Material::INPROGRESS => 'Folyamatban',
  18. Material::INSTOCK => 'Raktározva',
  19. Material::SOLD => 'Eladva',
  20. Material::LOCKED => 'Foglalva',
  21. ];
  22. /**
  23. * @ORM\Id
  24. * @ORM\GeneratedValue
  25. * @ORM\Column(type="integer")
  26. */
  27. private $id;
  28. /**
  29. * @ORM\ManyToOne(targetEntity=Projects::class, inversedBy="supplies")
  30. */
  31. private $project;
  32. /**
  33. * @ORM\Column(type="string", length=255)
  34. */
  35. private $name;
  36. /**
  37. * @ORM\Column(type="integer", nullable=true)
  38. */
  39. private $in_price_net;
  40. /**
  41. * @ORM\Column(type="integer", nullable=true)
  42. */
  43. private $in_price_br;
  44. /**
  45. * @ORM\Column(type="integer", nullable=true)
  46. */
  47. private $out_price_net;
  48. /**
  49. * @ORM\Column(type="integer", nullable=true)
  50. */
  51. private $out_price_br;
  52. /**
  53. * @ORM\Column(type="string", length=255, nullable=true)
  54. */
  55. private $supplier;
  56. /**
  57. * @ORM\Column(type="datetime", nullable=true)
  58. */
  59. private $created;
  60. /**
  61. * @ORM\Column(type="integer", nullable=true)
  62. */
  63. private $status;
  64. /**
  65. * @ORM\ManyToOne(targetEntity=ProjectProducts::class, inversedBy="materials")
  66. */
  67. private $projectProducts;
  68. /**
  69. * @ORM\Column(type="integer", nullable=true)
  70. */
  71. private $qty;
  72. public function __construct()
  73. {
  74. $this->qty = 1;
  75. }
  76. public function getId(): ?int
  77. {
  78. return $this->id;
  79. }
  80. public function getProject(): ?Projects
  81. {
  82. return $this->project;
  83. }
  84. public function setProject(?Projects $project): self
  85. {
  86. $this->project = $project;
  87. return $this;
  88. }
  89. public function getName(): ?string
  90. {
  91. return $this->name;
  92. }
  93. public function setName(string $name): self
  94. {
  95. $this->name = $name;
  96. return $this;
  97. }
  98. public function getInPriceNet(): ?int
  99. {
  100. return $this->in_price_net;
  101. }
  102. public function setInPriceNet(?int $in_price_net): self
  103. {
  104. $this->in_price_net = $in_price_net;
  105. return $this;
  106. }
  107. public function getInPriceBr(): ?int
  108. {
  109. return $this->in_price_br;
  110. }
  111. public function setInPriceBr(?int $in_price_br): self
  112. {
  113. $this->in_price_br = $in_price_br;
  114. return $this;
  115. }
  116. public function getOutPriceNet(): ?int
  117. {
  118. return $this->out_price_net;
  119. }
  120. public function setOutPriceNet(?int $out_price_net): self
  121. {
  122. $this->out_price_net = $out_price_net;
  123. return $this;
  124. }
  125. public function getOutPriceBr(): ?int
  126. {
  127. return $this->out_price_br;
  128. }
  129. public function setOutPriceBr(?int $out_price_br): self
  130. {
  131. $this->out_price_br = $out_price_br;
  132. return $this;
  133. }
  134. public function getSupplier(): ?string
  135. {
  136. return $this->supplier;
  137. }
  138. public function setSupplier(?string $supplier): self
  139. {
  140. $this->supplier = $supplier;
  141. return $this;
  142. }
  143. public function getCreated(): ?\DateTimeInterface
  144. {
  145. return $this->created;
  146. }
  147. public function setCreated(?\DateTimeInterface $created): self
  148. {
  149. $this->created = $created;
  150. return $this;
  151. }
  152. public function getStatus(): ?int
  153. {
  154. return $this->status;
  155. }
  156. public function getStatusName(): ?string
  157. {
  158. return self::$statuses[$this->status];
  159. }
  160. public function setStatus(?int $status): self
  161. {
  162. $this->status = $status;
  163. return $this;
  164. }
  165. public function getProjectProducts(): ?ProjectProducts
  166. {
  167. return $this->projectProducts;
  168. }
  169. public function setProjectProducts(?ProjectProducts $projectProducts): self
  170. {
  171. if($projectProducts){
  172. $this->setProject($projectProducts->getProject());
  173. }
  174. $this->projectProducts = $projectProducts;
  175. return $this;
  176. }
  177. public function getQty(): ?int
  178. {
  179. return $this->qty;
  180. }
  181. public function setQty(?int $qty): self
  182. {
  183. $this->qty = $qty;
  184. return $this;
  185. }
  186. }