No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

OrderStatus.php 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. }