src/Entity/Gestiform/Admin/Tarifs/TarifVenteThemeIntra.php line 14
<?php
namespace App\Entity\Gestiform\Admin\Tarifs;
use App\Repository\Gestiform\Admin\Tarifs\TarifVenteThemeIntraRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Entity(repositoryClass: TarifVenteThemeIntraRepository::class)]
class TarifVenteThemeIntra extends TarifVente
{
#[Assert\Regex('/\d+(\.\d+)?/')]
#[ORM\Column(type: 'decimal', precision: 10, scale: 2, nullable: true)]
private ?string $testPrerequisPersint = null;
#[Assert\Regex('/\d+(\.\d+)?/')]
#[ORM\Column(type: 'decimal', precision: 10, scale: 2, nullable: true)]
private ?string $testPrerequisPersext = null;
#[Assert\Regex('/\d+(\.\d+)?/')]
#[ORM\Column(type: 'decimal', precision: 10, scale: 2, nullable: true)]
private ?string $ingenierieJourint = null;
#[Assert\Regex('/\d+(\.\d+)?/')]
#[ORM\Column(type: 'decimal', precision: 10, scale: 2, nullable: true)]
private ?string $ingenierieJourext = null;
#[Assert\Regex('/\d+(\.\d+)?/')]
#[ORM\Column(type: 'decimal', precision: 10, scale: 2, nullable: true)]
private ?string $supportInternePersint = null;
#[Assert\Regex('/\d+(\.\d+)?/')]
#[ORM\Column(type: 'decimal', precision: 10, scale: 2, nullable: true)]
private ?string $supportInternePersext = null;
#[Assert\Regex('/\d+(\.\d+)?/')]
#[ORM\Column(type: 'decimal', precision: 10, scale: 2, nullable: true)]
private ?string $locationSalleJourint = null;
#[Assert\Regex('/\d+(\.\d+)?/')]
#[ORM\Column(type: 'decimal', precision: 10, scale: 2, nullable: true)]
private ?string $repasJourint = null;
#[Assert\Regex('/\d+(\.\d+)?/')]
#[ORM\Column(type: 'decimal', precision: 10, scale: 2, nullable: true)]
private ?string $testValidationPersint = null;
#[Assert\Regex('/\d+(\.\d+)?/')]
#[ORM\Column(type: 'decimal', precision: 10, scale: 2, nullable: true)]
private ?string $testValidationPersext = null;
#[ORM\OneToMany(mappedBy: 'tarifVenteThemeIntra', targetEntity: TarifVenteIntraJourClient::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
private Collection $intraJourClients;
#[ORM\OneToMany(mappedBy: 'tarifVenteThemeIntra', targetEntity: TarifVenteIntraJourOf::class, cascade: ['persist', 'remove'], orphanRemoval: true)]
private Collection $intraJourOfs;
public function __construct()
{
$this->intraJourClients = new ArrayCollection();
$this->intraJourOfs = new ArrayCollection();
}
public function getTestPrerequisPersint(): ?float
{
return $this->testPrerequisPersint;
}
public function setTestPrerequisPersint(?float $testPrerequisPersint): self
{
$this->testPrerequisPersint = $testPrerequisPersint;
return $this;
}
public function getTestPrerequisPersext(): ?float
{
return $this->testPrerequisPersext;
}
public function setTestPrerequisPersext(?float $testPrerequisPersext): self
{
$this->testPrerequisPersext = $testPrerequisPersext;
return $this;
}
public function getIngenierieJourint(): ?float
{
return $this->ingenierieJourint;
}
public function setIngenierieJourint(?float $ingenierieJourint): self
{
$this->ingenierieJourint = $ingenierieJourint;
return $this;
}
public function getIngenierieJourext(): ?float
{
return $this->ingenierieJourext;
}
public function setIngenierieJourext(?float $ingenierieJourext): self
{
$this->ingenierieJourext = $ingenierieJourext;
return $this;
}
public function getSupportInternePersint(): ?float
{
return $this->supportInternePersint;
}
public function setSupportInternePersint(?float $supportInternePersint): self
{
$this->supportInternePersint = $supportInternePersint;
return $this;
}
public function getSupportInternePersext(): ?float
{
return $this->supportInternePersext;
}
public function setSupportInternePersext(?float $supportInternePersext): self
{
$this->supportInternePersext = $supportInternePersext;
return $this;
}
public function getLocationSalleJourint(): ?float
{
return $this->locationSalleJourint;
}
public function setLocationSalleJourint(?float $locationSalleJourint): self
{
$this->locationSalleJourint = $locationSalleJourint;
return $this;
}
public function getRepasJourint(): ?float
{
return $this->repasJourint;
}
public function setRepasJourint(?float $repasJourint): self
{
$this->repasJourint = $repasJourint;
return $this;
}
public function getTestValidationPersint(): ?float
{
return $this->testValidationPersint;
}
public function setTestValidationPersint(?float $testValidationPersint): self
{
$this->testValidationPersint = $testValidationPersint;
return $this;
}
public function getTestValidationPersext(): ?float
{
return $this->testValidationPersext;
}
public function setTestValidationPersext(?float $testValidationPersext): self
{
$this->testValidationPersext = $testValidationPersext;
return $this;
}
/**
* @return Collection<int, TarifVenteIntraJourClient>
*/
public function getIntraJourClients(): Collection
{
return $this->intraJourClients;
}
public function addIntraJourClient(TarifVenteIntraJourClient $intraJourClient): self
{
if (!$this->intraJourClients->contains($intraJourClient)) {
$this->intraJourClients->add($intraJourClient);
$intraJourClient->setTarifVenteThemeIntra($this);
}
return $this;
}
public function removeIntraJourClient(TarifVenteIntraJourClient $intraJourClient): self
{
if ($this->intraJourClients->removeElement($intraJourClient)) {
// set the owning side to null (unless already changed)
if ($intraJourClient->getTarifVenteThemeIntra() === $this) {
$intraJourClient->setTarifVenteThemeIntra(null);
}
}
return $this;
}
/**
* @return Collection<int, TarifVenteIntraJourOf>
*/
public function getIntraJourOfs(): Collection
{
return $this->intraJourOfs;
}
public function addIntraJourOf(TarifVenteIntraJourOf $intraJourOf): self
{
if (!$this->intraJourOfs->contains($intraJourOf)) {
$this->intraJourOfs->add($intraJourOf);
$intraJourOf->setTarifVenteThemeIntra($this);
}
return $this;
}
public function removeIntraJourOf(TarifVenteIntraJourOf $intraJourOf): self
{
if ($this->intraJourOfs->removeElement($intraJourOf)) {
// set the owning side to null (unless already changed)
if ($intraJourOf->getTarifVenteThemeIntra() === $this) {
$intraJourOf->setTarifVenteThemeIntra(null);
}
}
return $this;
}
public function getTarifForValue($combien)
{
$lignemax=$this->getLignemax($this->getIntraJourOfs());
if($this->getIntraJourOfs())
{
$lignemax=$this->getLignemax(true);
foreach($this->getLignes() as $ligne)
{
if($ligne->isTarifjour() && $ligne->getValeurmin()==$combien){
return $ligne;
}
}
return $lignemax;
}else{
$lignemax=$this->getLignemax(false);
foreach($this->getLignes() as $ligne)
{
if(!$ligne->isTarifjour() && $ligne->getValeurmin()<=$combien && $ligne->getValeurmax()>=$combien){
return $ligne;
}
}
return $lignemax;
}
$lignemax=$this->getLignemax($this->getIntraJourOfs());
return $lignemax;
}
public function getLignemax($tarifjour)
{
$lignemax=null;
$valeurmax=0;
foreach($this->getLignes() as $ligne)
{
if($ligne->isTarifjour()==$tarifjour){
if($ligne->getValeurmin()>=$valeurmax){
$valeurmax=$ligne->getValeurmin();
$lignemax=$ligne;
}
}
}
return $lignemax;
}
}