|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- <?php
-
- namespace Lc\ShopBundle\Model;
-
- use Doctrine\ORM\Mapping as ORM;
- use Lc\ShopBundle\Context\OrderPaymentInterface;
- use Lc\ShopBundle\Context\ReductionInterface;
-
- /**
- * @ORM\MappedSuperclass()
- */
- abstract class OrderPayment extends AbstractEntity
- {
- const TYPE_CREDIT_CARD = 'cb' ;
- const TYPE_CHEQUE = 'cheque' ;
- const TYPE_CREDIT = 'credit' ;
-
- /**
- * @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\OrderShopInterface", inversedBy="orderPayments")
- * @ORM\JoinColumn(nullable=false)
- */
- protected $orderShop;
-
- /**
- * @ORM\Column(type="string", length=255)
- */
- protected $type;
-
- /**
- * @ORM\Column(type="text", nullable=true)
- */
- protected $reference;
-
- /**
- * @ORM\Column(type="datetime")
- */
- protected $paidAt;
-
- /**
- * @ORM\Column(type="float")
- */
- protected $amount;
-
- /**
- * @ORM\Column(type="text", nullable=true)
- */
- protected $comment;
-
-
- public function __toString()
- {
- return $this->amount. '€ par '.$this->type.' le '.$this->getPaidAt()->format('d-m-Y');
- }
-
- public function getOrderShop(): ?OrderShop
- {
- return $this->orderShop;
- }
-
- public function setOrderShop(?OrderShop $orderShop): self
- {
- $this->orderShop = $orderShop;
-
- return $this;
- }
-
- public function setType(string $type): self
- {
- $this->type = $type;
-
- return $this;
- }
-
- public function getReference(): ?string
- {
- return $this->reference;
- }
-
- public function setReference(?string $reference): self
- {
- $this->reference = $reference;
-
- return $this;
- }
-
- public function getPaidAt(): ?\DateTimeInterface
- {
- return $this->paidAt;
- }
-
- public function setPaidAt(\DateTimeInterface $paidAt): self
- {
- $this->paidAt = $paidAt;
-
- return $this;
- }
-
- public function getAmount(): ?float
- {
- return $this->amount;
- }
-
- public function setAmount(float $amount): self
- {
- $this->amount = $amount;
-
- return $this;
- }
-
- public function getComment(): ?string
- {
- return $this->comment;
- }
-
- public function setComment(?string $comment): self
- {
- $this->comment = $comment;
-
- return $this;
- }
- }
|