src/Entity/OnlineShop/ScaleShippingCost.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity\OnlineShop;
  3. use App\Entity\AbstractBase;
  4. use App\Repository\OnlineShop\ScaleShippingCostRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Gedmo\Mapping\Annotation as Gedmo;
  7. use Money\Money;
  8. /**
  9.  * @ORM\Table(name="vulco_order_scale_shipping_cost")
  10.  * @ORM\Entity(repositoryClass=ScaleShippingCostRepository::class)
  11.  * @Gedmo\SoftDeleteable(fieldName="removedAt", timeAware=false)
  12.  */
  13. class ScaleShippingCost extends AbstractBase
  14. {
  15.     /**
  16.      * @ORM\Column(type="money")
  17.      */
  18.     private Money $price;
  19.     /**
  20.      * @ORM\Column(type="integer")
  21.      */
  22.     private int $points;
  23.     /**
  24.      * @ORM\ManyToOne(targetEntity="App\Entity\OnlineShop\Supplier", inversedBy="scaleShippingCosts")
  25.      * @ORM\JoinColumn(name="supplier_id", referencedColumnName="id", onDelete="CASCADE")
  26.      */
  27.     private Supplier $supplier;
  28.     public function getPrice(): Money
  29.     {
  30.         return $this->price;
  31.     }
  32.     public function setPrice(Money $price): self
  33.     {
  34.         $this->price $price;
  35.         return $this;
  36.     }
  37.     public function getPoints(): int
  38.     {
  39.         return $this->points;
  40.     }
  41.     public function setPoints(int $points): self
  42.     {
  43.         $this->points $points;
  44.         return $this;
  45.     }
  46.     public function getSupplier(): Supplier
  47.     {
  48.         return $this->supplier;
  49.     }
  50.     public function setSupplier(Supplier $supplier): self
  51.     {
  52.         $this->supplier $supplier;
  53.         return $this;
  54.     }
  55.     public function __toString(): string
  56.     {
  57.         return 'Points: '.$this->points.' ยท Price: '.$this->price->getAmount().' '.$this->price->getCurrency()->getCode();
  58.     }
  59. }