src/Flexy/ShopBundle/Entity/Shipping/ShippingCalculationMethod.php line 11

  1. <?php
  2. namespace App\Flexy\ShopBundle\Entity\Shipping;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\Flexy\ShopBundle\Entity\Shipping\ShippingCalculationMethodRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassShippingCalculationMethodRepository::class)]
  7. #[ApiResource]
  8. class ShippingCalculationMethod
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $type null;
  16.     #[ORM\Column]
  17.     private ?float $price null;
  18.     #[ORM\ManyToOne(inversedBy'calculationMethods')]
  19.     private ?ShippingMethod $shippingMethod null;
  20.     public function __toString()
  21.     {
  22.         return "Type : ".ucfirst((string)$this->type);
  23.     }
  24.     public function getId(): ?int
  25.     {
  26.         return $this->id;
  27.     }
  28.     public function getType(): ?string
  29.     {
  30.         return $this->type;
  31.     }
  32.     public function setType(string $type): self
  33.     {
  34.         $this->type $type;
  35.         return $this;
  36.     }
  37.     public function getPrice(): ?float
  38.     {
  39.         return $this->price;
  40.     }
  41.     public function setPrice(float $price): self
  42.     {
  43.         $this->price $price;
  44.         return $this;
  45.     }
  46.     public function getShippingMethod(): ?ShippingMethod
  47.     {
  48.         return $this->shippingMethod;
  49.     }
  50.     public function setShippingMethod(?ShippingMethod $shippingMethod): self
  51.     {
  52.         $this->shippingMethod $shippingMethod;
  53.         return $this;
  54.     }
  55. }