src/Entity/PaymentMean.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * Carrier
  6. *
  7. * @ORM\Table(name="payment_means")
  8. * @ORM\Entity
  9. */
  10. class PaymentMean
  11. {
  12. /**
  13. * @var int
  14. *
  15. * @ORM\Column(name="id", type="integer", nullable=false)
  16. * @ORM\Id
  17. * @ORM\GeneratedValue(strategy="IDENTITY")
  18. */
  19. private $id;
  20. /**
  21. * @var string
  22. *
  23. * @ORM\Column(name="name", type="string", length=50, nullable=false)
  24. */
  25. private $name = '';
  26. /**
  27. * @var string|null
  28. *
  29. * @ORM\Column(name="code", type="string", length=50, nullable=true)
  30. */
  31. private $code = '';
  32. /**
  33. * @var boolean|null
  34. *
  35. * @ORM\Column(name="direct", type="boolean", nullable=true)
  36. */
  37. private $direct = '';
  38. public function getId(): int {
  39. return $this->id;
  40. }
  41. public function getName(): string {
  42. return $this->name;
  43. }
  44. public function getCode(): ?string {
  45. return $this->code;
  46. }
  47. public function getType(): ?string {
  48. return $this->type;
  49. }
  50. public function getDirect(): ?int {
  51. return $this->direct;
  52. }
  53. public function setId(int $id): void {
  54. $this->id = $id;
  55. }
  56. public function setName(string $name): void {
  57. $this->name = $name;
  58. }
  59. public function setCode(?string $code): void {
  60. $this->code = $code;
  61. }
  62. public function setDirect(?int $direct): void {
  63. $this->direct = $direct;
  64. }
  65. public function isDirect() {
  66. return $this->getDirect() == 1;
  67. }
  68. public function toArray() : array{
  69. $output = [
  70. 'id' => $this->getId(),
  71. 'name' => $this->getName(),
  72. 'code' => $this->getCode()
  73. ];
  74. return $output;
  75. }
  76. }