選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

109 行
2.5KB

  1. <?php
  2. namespace Lc\ShopBundle\Model;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. /**
  7. * @ORM\MappedSuperclass()
  8. */
  9. abstract class OrderStatus
  10. {
  11. /**
  12. * @ORM\Column(type="string", length=255)
  13. */
  14. protected $title;
  15. /**
  16. * @ORM\Column(type="text", nullable=true)
  17. */
  18. protected $description;
  19. /**
  20. * @ORM\ManyToMany(targetEntity="Lc\ShopBundle\Context\OrderStatusInterface")
  21. */
  22. protected $nextStatusAllowed;
  23. /**
  24. * @ORM\Column(type="string", length=255)
  25. */
  26. protected $alias;
  27. public function __toString()
  28. {
  29. return $this->title. ' ['.$this->alias.']';
  30. }
  31. public function __construct()
  32. {
  33. $this->nextStatusAllowed = new ArrayCollection();
  34. }
  35. public function getTitle(): ?string
  36. {
  37. return $this->title;
  38. }
  39. public function setTitle(string $title): self
  40. {
  41. $this->title = $title;
  42. return $this;
  43. }
  44. public function getDescription(): ?string
  45. {
  46. return $this->description;
  47. }
  48. public function setDescription(?string $description): self
  49. {
  50. $this->description = $description;
  51. return $this;
  52. }
  53. /**
  54. * @return Collection|self[]
  55. */
  56. public function getNextStatusAllowed(): Collection
  57. {
  58. return $this->nextStatusAllowed;
  59. }
  60. public function addNextStatusAllowed(self $nextStatusAllowed): self
  61. {
  62. if (!$this->nextStatusAllowed->contains($nextStatusAllowed)) {
  63. $this->nextStatusAllowed[] = $nextStatusAllowed;
  64. }
  65. return $this;
  66. }
  67. public function removeNextStatusAllowed(self $nextStatusAllowed): self
  68. {
  69. if ($this->nextStatusAllowed->contains($nextStatusAllowed)) {
  70. $this->nextStatusAllowed->removeElement($nextStatusAllowed);
  71. }
  72. return $this;
  73. }
  74. public function getAlias(): ?string
  75. {
  76. return $this->alias;
  77. }
  78. public function setAlias(string $alias): self
  79. {
  80. $this->alias = $alias;
  81. return $this;
  82. }
  83. }