<?php
namespace App\Entity;
use App\Repository\PaysRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=PaysRepository::class)
* @ORM\HasLifecycleCallbacks
*/
class Pays
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="string", length=255)
*/
private $codepays;
/**
* @ORM\Column(type="string", length=255)
*/
private $currency;
/**
* @ORM\Column(type="float")
*/
private $coursechange;
/**
* @ORM\Column(type="date", nullable=true)
*/
private $updatedAt;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $tva;
/**
* @ORM\OneToMany(targetEntity=User::class, mappedBy="payslocalisation")
*/
private $users;
/**
* @ORM\OneToMany(targetEntity=Ville::class, mappedBy="pays")
* @ORM\OrderBy({"name" = "ASC"})
*/
private $villes;
/**
* @ORM\OneToMany(targetEntity=Product::class, mappedBy="payslocalisation")
*/
private $products;
/**
* @ORM\OneToMany(targetEntity=IctoParamgeneral::class, mappedBy="pays")
*/
private $ictoParamgenerals;
public function __construct()
{
$this->users = new ArrayCollection();
$this->villes = new ArrayCollection();
$this->products = new ArrayCollection();
$this->ictoParamgenerals = new ArrayCollection();
}
public function __toString(){
return $this->getName();
}
/**
* Undocumented function
* @ORM\PrePersist
*/
public function dateUpdateCoursechange()
{
$this->updatedAt = new \DateTime();
}
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 getCodepays(): ?string
{
return $this->codepays;
}
public function setCodepays(string $codepays): self
{
$this->codepays = $codepays;
return $this;
}
public function getCurrency(): ?string
{
return $this->currency;
}
public function setCurrency(string $currency): self
{
$this->currency = $currency;
return $this;
}
public function getCoursechange(): ?float
{
return $this->coursechange;
}
/**
* Undocumented function
* @param float $coursechange
* @return self
*/
public function setCoursechange(float $coursechange): self
{
$this->coursechange = $coursechange;
$this->updatedAt = new \DateTime();
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getTva(): ?float
{
return $this->tva;
}
public function setTva(?float $tva): self
{
$this->tva = $tva;
return $this;
}
/**
* @return Collection<int, User>
*/
public function getUsers(): Collection
{
return $this->users;
}
public function addUser(User $user): self
{
if (!$this->users->contains($user)) {
$this->users[] = $user;
$user->setPayslocalisation($this);
}
return $this;
}
public function removeUser(User $user): self
{
if ($this->users->removeElement($user)) {
// set the owning side to null (unless already changed)
if ($user->getPayslocalisation() === $this) {
$user->setPayslocalisation(null);
}
}
return $this;
}
/**
* @return Collection<int, Ville>
*/
public function getVilles(): Collection
{
return $this->villes;
}
public function addVille(Ville $ville): self
{
if (!$this->villes->contains($ville)) {
$this->villes[] = $ville;
$ville->setPays($this);
}
return $this;
}
public function removeVille(Ville $ville): self
{
if ($this->villes->removeElement($ville)) {
// set the owning side to null (unless already changed)
if ($ville->getPays() === $this) {
$ville->setPays(null);
}
}
return $this;
}
/**
* @return Collection<int, Product>
*/
public function getProducts(): Collection
{
return $this->products;
}
public function addProduct(Product $product): self
{
if (!$this->products->contains($product)) {
$this->products[] = $product;
$product->setPayslocalisation($this);
}
return $this;
}
public function removeProduct(Product $product): self
{
if ($this->products->removeElement($product)) {
// set the owning side to null (unless already changed)
if ($product->getPayslocalisation() === $this) {
$product->setPayslocalisation(null);
}
}
return $this;
}
/**
* @return Collection<int, IctoParamgeneral>
*/
public function getIctoParamgenerals(): Collection
{
return $this->ictoParamgenerals;
}
public function addIctoParamgeneral(IctoParamgeneral $ictoParamgeneral): self
{
if (!$this->ictoParamgenerals->contains($ictoParamgeneral)) {
$this->ictoParamgenerals[] = $ictoParamgeneral;
$ictoParamgeneral->setPays($this);
}
return $this;
}
public function removeIctoParamgeneral(IctoParamgeneral $ictoParamgeneral): self
{
if ($this->ictoParamgenerals->removeElement($ictoParamgeneral)) {
// set the owning side to null (unless already changed)
if ($ictoParamgeneral->getPays() === $this) {
$ictoParamgeneral->setPays(null);
}
}
return $this;
}
}