DolibarrOrder.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\ApiResources\Dolibarr;
  4. use ApiPlatform\Metadata\ApiProperty;
  5. use ApiPlatform\Metadata\ApiResource;
  6. use ApiPlatform\Metadata\Get;
  7. use App\ApiResources\ApiResourcesInterface;
  8. use Symfony\Component\Serializer\Annotation\Groups;
  9. /**
  10. * Order of a society, retrieved from dolibarr.
  11. */
  12. #[ApiResource(
  13. operations: [
  14. new Get(),
  15. ]
  16. )]
  17. class DolibarrOrder implements ApiResourcesInterface
  18. {
  19. /**
  20. * Id of the dolibarr bill ( = invoice).
  21. */
  22. #[ApiProperty(identifier: true)]
  23. #[Groups('dolibarr_get')]
  24. private int $id;
  25. /**
  26. * Bill reference.
  27. */
  28. #[Groups('dolibarr_get')]
  29. private string $ref;
  30. /**
  31. * Date of the bill.
  32. */
  33. #[Groups('dolibarr_get')]
  34. private \DateTime $date;
  35. public function getId(): int
  36. {
  37. return $this->id;
  38. }
  39. public function setId(int $id): self
  40. {
  41. $this->id = $id;
  42. return $this;
  43. }
  44. public function getRef(): string
  45. {
  46. return $this->ref;
  47. }
  48. public function setRef(string $ref): self
  49. {
  50. $this->ref = $ref;
  51. return $this;
  52. }
  53. public function getDate(): \DateTime
  54. {
  55. return $this->date;
  56. }
  57. public function setDate(\DateTime $date): self
  58. {
  59. $this->date = $date;
  60. return $this;
  61. }
  62. }