src/Entity/TipoCargoVenta.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Gedmo\Mapping\Annotation as Gedmo;
  7. /**
  8.  * @ORM\Entity(repositoryClass="App\Repository\TipoCargoVentaRepository")
  9.  * @ORM\Table(name="tipo_cargo_venta")
  10.  * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
  11.  */
  12. class TipoCargoVenta extends TipoCargoAbstract
  13. {
  14.     /**
  15.      * @ORM\OneToMany(targetEntity=\App\Entity\AccionVenta::class, mappedBy="tipo")
  16.      */
  17.     private $accionesVenta;
  18.     public function __construct()
  19.     {
  20.         parent::__construct();
  21.         $this->accionesVenta = new ArrayCollection();
  22.     }
  23.     /**
  24.      * @return Collection<int, AccionVenta>
  25.      */
  26.     public function getAccionesVenta(): Collection
  27.     {
  28.         return $this->accionesVenta;
  29.     }
  30.     public function addAccionesVentum(AccionVenta $accionesVentum): static
  31.     {
  32.         if (!$this->accionesVenta->contains($accionesVentum)) {
  33.             $this->accionesVenta->add($accionesVentum);
  34.             $accionesVentum->setTipo($this);
  35.         }
  36.         return $this;
  37.     }
  38.     public function removeAccionesVentum(AccionVenta $accionesVentum): static
  39.     {
  40.         if ($this->accionesVenta->removeElement($accionesVentum)) {
  41.             // set the owning side to null (unless already changed)
  42.             if ($accionesVentum->getTipo() === $this) {
  43.                 $accionesVentum->setTipo(null);
  44.             }
  45.         }
  46.         return $this;
  47.     }
  48. }