src/Flexy/Apps/TransportBundle/Entity/MissionExtraFeesType.php line 13
<?php
namespace App\Flexy\Apps\TransportBundle\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use App\Repository\Flexy\TransportBundle\Entity\MissionExtraFeesTypeRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: MissionExtraFeesTypeRepository::class)]
#[ApiResource]
class MissionExtraFeesType
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\Column]
private ?float $price = null;
#[ORM\OneToMany(mappedBy: 'missionExtraFeesType', targetEntity: MissionExtraFees::class)]
private Collection $missionExtraFees;
public function __construct()
{
$this->missionExtraFees = new ArrayCollection();
}
public function __toString()
{
return $this->name." : ".$this->price." EUR";
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getPrice(): ?float
{
return $this->price;
}
public function setPrice(float $price): self
{
$this->price = $price;
return $this;
}
/**
* @return Collection<int, MissionExtraFees>
*/
public function getMissionExtraFees(): Collection
{
return $this->missionExtraFees;
}
public function addMissionExtraFee(MissionExtraFees $missionExtraFee): self
{
if (!$this->missionExtraFees->contains($missionExtraFee)) {
$this->missionExtraFees->add($missionExtraFee);
$missionExtraFee->setMissionExtraFeesType($this);
}
return $this;
}
public function removeMissionExtraFee(MissionExtraFees $missionExtraFee): self
{
if ($this->missionExtraFees->removeElement($missionExtraFee)) {
// set the owning side to null (unless already changed)
if ($missionExtraFee->getMissionExtraFeesType() === $this) {
$missionExtraFee->setMissionExtraFeesType(null);
}
}
return $this;
}
}