AbstractBillingPayer.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php
  2. namespace AppBundle\Entity\Billing;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Dunglas\ApiBundle\Annotation\Iri;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. use AppBundle\Annotation\DefaultField;
  9. use AppBundle\Entity\Traits\TimestampableEntity;
  10. use AppBundle\Entity\Traits\CreatorUpdaterEntity;
  11. /**
  12. * Fais le lien entre l'Access qui règle la facture et l'Access ou
  13. * l'EducationalProject concerné par la facture
  14. * Classe de base de @see AccessPayer, EducationalProjectPayer
  15. *
  16. * @Iri("http://schema.org/BillingPayer")
  17. */
  18. #[ORM\Entity]
  19. #[ORM\Table(name: 'BillingPayer')]
  20. #[ORM\InheritanceType('SINGLE_TABLE')]
  21. #[ORM\DiscriminatorColumn(name: 'discr', type: 'string')]
  22. #[ORM\DiscriminatorMap(['access' => 'AccessPayer', 'educationalproject' => 'EducationalProjectPayer'])]
  23. abstract class AbstractBillingPayer
  24. {
  25. use TimestampableEntity;
  26. use CreatorUpdaterEntity;
  27. /**
  28. * @var int
  29. */
  30. #[ORM\Column(type: 'integer')]
  31. #[ORM\Id]
  32. #[ORM\GeneratedValue(strategy: 'AUTO')]
  33. #[Groups(['accesspayer', 'educationalprojectpayer', 'access_details', 'student_registration', 'educationalproject_details', 'payer_list', 'accessbilling_edit'])]
  34. private $id;
  35. /**
  36. * @var float
  37. */
  38. #[ORM\Column(type: 'float', nullable: false)]
  39. #[Assert\Type(type: 'float')]
  40. #[Assert\NotNull]
  41. #[Groups(['accesspayer', 'educationalprojectpayer', 'access_details_billingpayers', 'student_registration_billingreceivers', 'educationalproject_details_billingreceivers', 'payer_list_billingpayers', 'accessbilling_edit_billingreceivers', 'accessbilling_edit_billingpayers', 'accessbilling_edit_billingeducationalprojectpayers'])]
  42. private $paymentPart;
  43. /**
  44. * The constructor
  45. */
  46. public function __construct() {
  47. }
  48. /**
  49. * Sets id.
  50. *
  51. * @param int $id
  52. *
  53. * @return $this
  54. */
  55. public function setId($id)
  56. {
  57. $this->id = $id;
  58. return $this;
  59. }
  60. /**
  61. * Gets id.
  62. *
  63. * @return int
  64. */
  65. public function getId()
  66. {
  67. return $this->id;
  68. }
  69. /**
  70. * Set paymentPart
  71. *
  72. * @param float $paymentPart
  73. *
  74. * @return AbstractBillingPayer
  75. */
  76. public function setPaymentPart($paymentPart)
  77. {
  78. $this->paymentPart = floatval($paymentPart);
  79. return $this;
  80. }
  81. /**
  82. * Get paymentPart
  83. *
  84. * @return float
  85. */
  86. public function getPaymentPart()
  87. {
  88. return $this->paymentPart;
  89. }
  90. }