*/ #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Billing\BillLine', mappedBy: 'equipmentLoan', orphanRemoval: true)] #[Groups(['equipmentloan_billline'])] private $billLines; /** * @var ArrayCollection */ #[Assert\Valid] #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Billing\BillingIntangibleExcludeDate', mappedBy: 'equipmentLoan', cascade: ['persist'], orphanRemoval: true)] #[Groups(['accessfictionalintangible', 'accessequipment_grid_equipmentloans', 'own_access_equipmentloans'])] private $billingIntangibleExcludeDates; /** * @var string * @ExportSplitFields({"borrower.person.name","borrower.person.givenName","type","startDate","endDate"}) * */ #[Groups(['template'])] private $fullLabelTemplate; /** * @var ArrayCollection */ #[ORM\ManyToMany(targetEntity: 'AppBundle\Entity\Core\Tagg', cascade: ['persist'], inversedBy: 'equipmentLoans')] #[Assert\Valid] #[ORM\JoinTable(name: 'tag_equipmentLoan', joinColumns: [], inverseJoinColumns: [])] #[ORM\JoinColumn(name: 'equipmentLoan_id', referencedColumnName: 'id')] #[ORM\JoinColumn(name: 'tag_id', referencedColumnName: 'id')] #[Groups(['equipmentloan_tags', 'manage_tags', 'equipmentloan_list', 'equipmentrent_list'])] private $tags; public function __construct() { $this->billLines = new ArrayCollection(); $this->billingIntangibleExcludeDates = new ArrayCollection(); $this->tags = new ArrayCollection(); } /** * Sets id. * * @param int $id * * @return $this */ public function setId($id) { $this->id = $id; return $this; } /** * Gets id. * * @return int */ public function getId() { return $this->id; } /** * @param Access|null $borrower * @return $this */ public function setBorrower(Access $borrower = null) { $this->borrower = $borrower; return $this; } /** * Gets Borrower. * * @return Access */ public function getBorrower() { return $this->borrower; } /** * Sets equipment. * * @param Equipment $equipment * * @return $this */ public function setEquipment(Equipment $equipment = null) { $this->equipment = $equipment; return $this; } /** * Gets equipment. * * @return Equipment */ public function getEquipment() { return $this->equipment; } /** * Sets endDateTheorical. * * @param \DateTime $endDateTheorical * * @return $this */ public function setEndDateTheorical(\DateTime $endDateTheorical = null) { $this->endDateTheorical = $endDateTheorical; return $this; } /** * Gets endDateTheorical. * * @return \DateTime */ public function getEndDateTheorical() { return $this->endDateTheorical ? $this->endDateTheorical->format('Y-m-d') : $this->endDateTheorical; } /** * Sets type. * * @param string $type * * @return $this */ public function setType($type) { $this->type = $type; return $this; } /** * Gets type. * * @return string */ public function getType() { return $this->type; } /** * Sets deposit. * * @param float $deposit * * @return $this */ public function setDeposit($deposit) { $this->deposit = floatval($deposit); return $this; } /** * Gets deposit. * * @return float */ public function getDeposit() { return $this->deposit; } /** * Sets amount. * * @param float $amount * * @return $this */ public function setAmount($amount) { $this->amount = floatval($amount); return $this; } /** * Gets amount. * * @return float */ public function getAmount() { return $this->amount; } /** * Add billLine * * @param \AppBundle\Entity\Billing\BillLine $billLine * * @return EquipmentLoan */ public function addBillLine(\AppBundle\Entity\Billing\BillLine $billLine) { $this->billLines[] = $billLine; return $this; } /** * Remove billLine * * @param \AppBundle\Entity\Billing\BillLine $billLine */ public function removeBillLine(\AppBundle\Entity\Billing\BillLine $billLine) { $this->billLines->removeElement($billLine); } /** * Get billLines * * @return \Doctrine\Common\Collections\Collection */ public function getBillLines() { return $this->billLines; } /** * Add billingIntangibleExcludeDate * * @param \AppBundle\Entity\Billing\BillingIntangibleExcludeDate $billingIntangibleExcludeDate * * @return EquipmentLoan */ public function addBillingIntangibleExcludeDate(\AppBundle\Entity\Billing\BillingIntangibleExcludeDate $billingIntangibleExcludeDate) { $this->billingIntangibleExcludeDates[] = $billingIntangibleExcludeDate; return $this; } /** * Remove billingIntangibleExcludeDate * * @param \AppBundle\Entity\Billing\BillingIntangibleExcludeDate $billingIntangibleExcludeDate */ public function removeBillingIntangibleExcludeDate(\AppBundle\Entity\Billing\BillingIntangibleExcludeDate $billingIntangibleExcludeDate) { $this->billingIntangibleExcludeDates->removeElement($billingIntangibleExcludeDate); } /** * Get billingIntangibleExcludeDates * * @return \Doctrine\Common\Collections\Collection */ public function getBillingIntangibleExcludeDates() { return $this->billingIntangibleExcludeDates; } /** * Set forcingAmount * * @param boolean $forcingAmount * * @return EquipmentLoan */ public function setForcingAmount($forcingAmount) { $this->forcingAmount = $forcingAmount; return $this; } /** * Get forcingAmount * * @return boolean */ public function getForcingAmount() { return $this->forcingAmount; } /** * Gets full label. * * @return array */ public function getFullLabelTemplate() { $fullLabel = []; $fullLabel[] = $this->getBorrower() ? $this->getBorrower()->getPerson()->getFullNameTemplate() : ''; $fullLabel[] = ['value' => $this->getType(), 'translate' => true]; $fullLabel[] = ['type' => 'date', 'value' => $this->getStartDate()]; if(!empty($this->getEndDate())) $fullLabel[] = ['type' => 'date', 'value' => $this->getEndDate()]; return $fullLabel; } /** * Add tag * * @param \AppBundle\Entity\Core\Tagg $tag * * @return EquipmentLoan */ public function addTag(\AppBundle\Entity\Core\Tagg $tag) { $this->tags[] = $tag; return $this; } /** * Remove tag * * @param \AppBundle\Entity\Core\Tagg $tag */ public function removeTag(\AppBundle\Entity\Core\Tagg $tag) { $this->tags->removeElement($tag); } /** * Get tags * * @return \Doctrine\Common\Collections\Collection */ public function getTags() { return $this->tags; } }