<?php
namespace App\Entity\Gos;
use App\Entity\Gos\Uniqskills\OrderCancellation;
use App\Entity\Gos\Uniqskills\OrderCycle;
use App\Entity\Gos\Uniqskills\UserCertificate;
use App\Entity\Gos\VirtualCurrency\VirtualCurrencyTransaction;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* OrderPart
*
* @ORM\Table(name="order_part")
* @ORM\Entity(repositoryClass="App\Repository\OrderPartRepository")
* @ORM\HasLifecycleCallbacks
*/
class OrderPart
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(type="string", length=150, nullable=true)
*/
private $ordTran;
/**
* @var boolean
*
* @ORM\Column(type="boolean", nullable=true)
*/
private $verification;
/**
* @var \DateTime
*
* @ORM\Column(type="datetime", nullable=true)
*/
private $verificationDate;
/**
* @var float
*
* @ORM\Column(type="float", precision=18, scale=2)
*/
private $totalPriceGross;
/**
* @var float
*
* @ORM\Column(type="float", precision=18, scale=2)
*/
private $totalPriceNet;
/**
* @var float
*
* @ORM\Column(type="float", precision=18, scale=2, nullable=true)
*/
private $totalShippingCostGross;
/**
* @var float
*
* @ORM\Column(type="float", precision=18, scale=2, nullable=true)
*/
private $totalShippingCostNet;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Gos\Orders", inversedBy="orderPart")
* @ORM\JoinColumn()
*/
private $orders;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\OrderProductVariant", mappedBy="orderPart", cascade={"persist"})
*/
private $orderProductVariant;
/**
* @ORM\OneToOne(targetEntity="App\Entity\Gos\Notify", inversedBy="masterOrderPart", cascade={"persist"})
* @ORM\JoinColumn(onDelete="CASCADE")
*/
private $masterNotify;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Gos\Notify", mappedBy="orderPart")
*/
private $notify;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Gos\PaymentMethod", inversedBy="orderPart")
* @ORM\JoinColumn()
*/
private $paymentMethod;
/**
* @var boolean
*
* @ORM\Column(type="boolean", nullable=true)
*/
private $updateProductVariant;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $deletedAt;
/**
* @var boolean
*
* @ORM\Column(type="boolean", options={"default": true})
*/
private $isCorrect = true;
/**
* @ORM\OneToOne(targetEntity="App\Entity\Gos\Uniqskills\OrderCancellation", mappedBy="orderPart")
*/
private $orderCancellation;
/**
* @ORM\Column(type="boolean", options={"default": false})
*/
private $isCancellation = false;
/**
* @ORM\OneToOne(targetEntity="App\Entity\Gos\OrdersAwaiting", mappedBy="orderPart", cascade={"persist", "remove"})
*/
private $ordersAwaiting;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isSubscriptionRenewed;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $isTrialRecurring;
/**
* @ORM\Column(type="boolean", options={"default": false})
*/
private $isTrialExtended = false;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $dateNextInvoice;
/**
* @ORM\OneToOne(targetEntity=Orders::class, cascade={"persist", "remove"})
*/
private $newOrdersCreatedFromTrial;
/**
* @ORM\OneToMany(targetEntity=CancellationFoResponse::class, mappedBy="orderPart")
*/
private $cancellationFoResponses;
/**
* @ORM\OneToMany(targetEntity=VirtualCurrencyTransaction::class, mappedBy="orderPart")
*/
private $virtualCurrencyTransactions;
/**
* @ORM\Column(type="boolean", options={"default": false})
*/
private $isPaid = false;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $paymentVerifiedOn;
/**
* @ORM\OneToMany(targetEntity=UserCertificate::class, mappedBy="orderPart")
*/
private $userCertificates;
/**
* @ORM\OneToMany(targetEntity=NewCardTokenRequest::class, mappedBy="orderPart")
*/
private $newCardTokenRequests;
/** @ORM\PrePersist() */
public function prePersist()
{
if (empty($this->createdAt))
{
$this->createdAt = new \DateTime();
}
}
/** @ORM\PreUpdate() */
public function preUpdate()
{
$this->updatedAt = new \DateTime();
}
public function __toString()
{
return (string)$this->ordTran;
}
public function getObjectVars()
{
return get_object_vars($this);
}
public function hasEventProduct()
{
if (!$this->getOrderProductVariant()->isEmpty())
{
foreach ($this->getOrderProductVariant() as $opv)
{
/** @var OrderProductVariant $opv */
if ($opv->getProductVariant()->isEvent())
{
return true;
}
}
}
return false;
}
public function hasEventAssigned()
{
if (!$this->getOrderProductVariant()->isEmpty())
{
foreach ($this->getOrderProductVariant() as $opv)
{
/** @var OrderProductVariant $opv */
if ($opv->getProductVariant()->getEvent() instanceof Events
&& $opv->getProductVariant()->getEvent()->getDontSendNotifications() !== true)
{
return true;
}
}
}
return false;
}
public function omittedShippingCostsInAllProducts(): bool
{
if (!$this->getOrderProductVariant()->isEmpty())
{
foreach ($this->getOrderProductVariant() as $opv)
{
/** @var OrderProductVariant $opv */
if ($opv->getPrimaryVariant())
{
continue;
}
if (!$opv->getOmittedShippingCosts())
{
return false;
}
}
}
return true;
}
public function hasProductOnEventTypeName($names = [])
{
if (!$this->getOrderProductVariant()->isEmpty())
{
foreach ($this->getOrderProductVariant() as $opv)
{
/** @var OrderProductVariant $opv */
if (
$opv->getProductVariant()->getMasterProduct()->getProductGosType() !== null
&& $opv->getProductVariant()->getMasterProduct()->getEventType() !== null
&& $opv->getProductVariant()->getMasterProduct()->getProductGosType()->getName() === 'event'
&& in_array($opv->getProductVariant()->getMasterProduct()->getEventType()->getName(), $names, false)
)
{
return true;
}
}
}
return false;
}
public function checkIfPayOnlineIsActive()
{
/** @var OrderProductVariant $opv */
foreach ($this->getOrderProductVariant() as $opv)
{
if (!$opv->checkIfProductVariantHavePaymentMethod('online'))
{
return false;
}
}
return true;
}
public function checkIfProformaIsActive()
{
/** @var OrderProductVariant $opv */
foreach ($this->getOrderProductVariant() as $opv)
{
if (!$opv->checkIfProductVariantHavePaymentMethod('proforma-invoice'))
{
return false;
}
}
return true;
}
public function checkIfToHideInSB()
{
/** @var OrderProductVariant $opv */
foreach ($this->getOrderProductVariant() as $opv)
{
if ($opv->checkIfProductVariantHaveToBeHiddenInSB())
{
return true;
}
}
return false;
}
/**
* Add orderProductVariant
*
* @param \App\Entity\Gos\OrderProductVariant $orderProductVariant
*
* @return OrderPart
*/
public function setOrderProductVariant(\App\Entity\Gos\OrderProductVariant $orderProductVariant)
{
$this->orderProductVariant[] = $orderProductVariant;
return $this;
}
/**
* Set orders
*
* @param \App\Entity\Gos\Orders $orders
*
* @return OrderPart
*/
public function setOrders(\App\Entity\Gos\Orders $orders = null)
{
$this->orders = $orders;
if (!empty($orders))
{
$orders->addOrderPart($this);
}
return $this;
}
public function hasTestProduct()
{
/** @var OrderProductVariant $orderProductVariant */
foreach ($this->getOrderProductVariant() as $orderProductVariant)
{
/** @var \App\Entity\Gos\ProductVariant $productVariant */
$productVariant = $orderProductVariant->getProductVariant();
if (
!empty($productVariant)
&& $productVariant->getIsTest()
)
{
return true;
}
}
return false;
}
//------------------------------ setters & getters
/**
* Get id
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set totalShippingCostGross
*
* @param float $totalShippingCostGross
*
* @return OrderPart
*/
public function setTotalShippingCostGross($totalShippingCostGross)
{
$this->totalShippingCostGross = $totalShippingCostGross;
return $this;
}
/**
* Get totalShippingCostGross
*
* @return float
*/
public function getTotalShippingCostGross()
{
return $this->totalShippingCostGross;
}
/**
* Set totalShippingCostNet
*
* @param float $totalShippingCostNet
*
* @return OrderPart
*/
public function setTotalShippingCostNet($totalShippingCostNet)
{
$this->totalShippingCostNet = $totalShippingCostNet;
return $this;
}
/**
* Get totalShippingCostNet
*
* @return float
*/
public function getTotalShippingCostNet()
{
return $this->totalShippingCostNet;
}
/**
* Set ordTran
*
* @param string $ordTran
*
* @return OrderPart
*/
public function setOrdTran($ordTran)
{
$this->ordTran = $ordTran;
return $this;
}
/**
* Get ordTran
*
* @return string
*/
public function getOrdTran()
{
return $this->ordTran;
}
/**
* Set createdAt
*
* @param \DateTime $createdAt
*
* @return OrderPart
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* Get createdAt
*
* @return \DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* Set updatedAt
*
* @param \DateTime $updatedAt
*
* @return OrderPart
*/
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* Get updatedAt
*
* @return \DateTime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* Get orders
*
* @return \App\Entity\Gos\Orders
*/
public function getOrders()
{
return $this->orders;
}
/**
* Constructor
*/
public function __construct()
{
$this->orderProductVariant = new \Doctrine\Common\Collections\ArrayCollection();
$this->notify = new ArrayCollection();
$this->virtualCurrencyTransactions = new ArrayCollection();
$this->newCardTokenRequests = new ArrayCollection();
$this->userCertificates = new ArrayCollection();
}
/**
* Add orderProductVariant
*
* @param \App\Entity\Gos\OrderProductVariant $orderProductVariant
*
* @return OrderPart
*/
public function addOrderProductVariant(\App\Entity\Gos\OrderProductVariant $orderProductVariant)
{
$orderProductVariant->setOrderPart($this);
return $this;
}
/**
* Remove orderProductVariant
*
* @param \App\Entity\Gos\OrderProductVariant $orderProductVariant
*/
public function removeOrderProductVariant(\App\Entity\Gos\OrderProductVariant $orderProductVariant)
{
$this->orderProductVariant->removeElement($orderProductVariant);
}
/**
* Get orderProductVariant
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getOrderProductVariant()
{
return $this->orderProductVariant;
}
/**
* Set totalPriceGross
*
* @param float $totalPriceGross
*
* @return OrderPart
*/
public function setTotalPriceGross($totalPriceGross)
{
$this->totalPriceGross = round($totalPriceGross,2);
return $this;
}
/**
* Get totalPriceGross
*
* @return float
*/
public function getTotalPriceGross()
{
return $this->totalPriceGross;
}
/**
* Set totalPriceNet
*
* @param float $totalPriceNet
*
* @return OrderPart
*/
public function setTotalPriceNet($totalPriceNet)
{
$this->totalPriceNet = round($totalPriceNet,2);
return $this;
}
/**
* Get totalPriceNet
*
* @return float
*/
public function getTotalPriceNet()
{
return $this->totalPriceNet;
}
/**
* Set masterNotify
*
* @param \App\Entity\Gos\Notify $masterNotify
*
* @return OrderPart
*/
public function setMasterNotify(\App\Entity\Gos\Notify $masterNotify = null)
{
$this->masterNotify = $masterNotify;
return $this;
}
/**
* Get masterNotify
*
* @return \App\Entity\Gos\Notify
*/
public function getMasterNotify()
{
return $this->masterNotify;
}
/**
* Add notify
*
* @param \App\Entity\Gos\Notify $notify
*
* @return OrderPart
*/
public function addNotify(\App\Entity\Gos\Notify $notify)
{
$this->notify[] = $notify;
return $this;
}
/**
* Remove notify
*
* @param \App\Entity\Gos\Notify $notify
*/
public function removeNotify(\App\Entity\Gos\Notify $notify)
{
$this->notify->removeElement($notify);
}
/**
* Get notify
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getNotify()
{
return $this->notify;
}
/**
* Set paymentMethod
*
* @param \App\Entity\Gos\PaymentMethod $paymentMethod
*
* @return OrderPart
*/
public function setPaymentMethod(\App\Entity\Gos\PaymentMethod $paymentMethod = null)
{
$this->paymentMethod = $paymentMethod;
return $this;
}
/**
* Get paymentMethod
*
* @return \App\Entity\Gos\PaymentMethod
*/
public function getPaymentMethod()
{
return $this->paymentMethod;
}
/**
* Set verification
*
* @param boolean $verification
*
* @return OrderPart
*/
public function setVerification($verification)
{
$this->verification = $verification;
return $this;
}
/**
* Get verification
*
* @return boolean
*/
public function getVerification()
{
return $this->verification;
}
/**
* Set verificationDate
*
* @param \DateTime $verificationDate
*
* @return OrderPart
*/
public function setVerificationDate($verificationDate)
{
$this->verificationDate = $verificationDate;
return $this;
}
/**
* Get verificationDate
*
* @return \DateTime
*/
public function getVerificationDate()
{
return $this->verificationDate;
}
/**
* Set deletedAt
*
* @param \DateTime $deletedAt
*
* @return OrderPart
*/
public function setDeletedAt($deletedAt)
{
$this->deletedAt = $deletedAt;
return $this;
}
/**
* Get deletedAt
*
* @return \DateTime
*/
public function getDeletedAt()
{
return $this->deletedAt;
}
/**
* Set updateProductVariant
*
* @param boolean $updateProductVariant
*
* @return OrderPart
*/
public function setUpdateProductVariant($updateProductVariant)
{
$this->updateProductVariant = $updateProductVariant;
return $this;
}
/**
* Get updateProductVariant
*
* @return boolean
*/
public function getUpdateProductVariant()
{
return $this->updateProductVariant;
}
/**
* Set isCorrect
*
* @param boolean $isCorrect
*
* @return OrderPart
*/
public function setIsCorrect($isCorrect)
{
$this->isCorrect = $isCorrect;
return $this;
}
/**
* Get isCorrect
*
* @return boolean
*/
public function getIsCorrect()
{
return $this->isCorrect;
}
public function isGift()
{
return (!$this->getOrderProductVariantsToGift()->isEmpty() && !empty($this->getOrders()->getBuyerGift()));
}
public function getOrderProductVariantsToGift()
{
if (!empty($this->orderProductVariant))
{
return $this->getOrderProductVariant()->filter(
function ($orderProductVariant) {
return !empty($orderProductVariant->getGift());
}
);
}
return new ArrayCollection();
}
public function hasRecurringPaymentProducts(): bool
{
foreach ($this->orderProductVariant as $opv)
{
/** @var OrderProductVariant $opv */
if ($opv->getProductVariant()->getIsRecurringSubscription())
{
return true;
}
}
return false;
}
public function hasTrialProducts(): bool
{
/** @var OrderProductVariant $opv */
foreach ($this->orderProductVariant as $opv)
{
if ($opv->getProductVariant()->getStateIsTrialRecurring())
{
return true;
}
}
return false;
}
public function getTrialProduct()
{
/** @var OrderProductVariant $opv */
foreach ($this->orderProductVariant as $opv)
{
if ($opv->getProductVariant()->getStateIsTrialRecurring())
{
return $opv->getProductVariant();
}
}
return false;
}
public function hasUniqskillsProducts()
{
foreach ($this->orderProductVariant as $opv)
{
/** @var OrderProductVariant $opv */
if (!$opv->getProductVariant()->getCourses()->isEmpty())
{
return true;
}
}
return false;
}
public function hasOnlyUniqskillsProducts()
{
foreach ($this->orderProductVariant as $opv)
{
/** @var OrderProductVariant $opv */
if ($opv->getProductVariant()->getCourses()->isEmpty())
{
return false;
}
}
return true;
}
public function hasDelayedProformaProducts()
{
foreach ($this->orderProductVariant as $opv)
{
/** @var OrderProductVariant $opv */
if ($opv->checkIfProductVariantHavePaymentMethod('delayed-proforma'))
{
return true;
}
}
return false;
}
public function getIsSubscriptionRenewed(): ?bool
{
return $this->isSubscriptionRenewed;
}
public function setIsSubscriptionRenewed(?bool $isSubscriptionRenewed): self
{
$this->isSubscriptionRenewed = $isSubscriptionRenewed;
return $this;
}
public function getIsTrialRecurring(): ?bool
{
return $this->isTrialRecurring;
}
public function setIsTrialRecurring(?bool $isTrialRecurring): self
{
$this->isTrialRecurring = $isTrialRecurring;
return $this;
}
public function getIsTrialExtended(): ?bool
{
return $this->isTrialExtended;
}
public function setIsTrialExtended(?bool $isTrialExtended): self
{
$this->isTrialExtended = $isTrialExtended;
return $this;
}
public function getOrderCancellation(): ?OrderCancellation
{
return $this->orderCancellation;
}
public function setOrderCancellation(?OrderCancellation $orderCancellation): self
{
$this->orderCancellation = $orderCancellation;
}
/**
* Set isCancellation
*
* @param boolean $isCancellation
*
* @return OrderPart
*/
public function setIsCancellation($isCancellation)
{
$this->isCancellation = $isCancellation;
return $this;
}
/**
* Get isCancellation
*
* @return boolean
*/
public function getIsCancellation()
{
return $this->isCancellation;
}
public function getOrdersAwaiting(): ?OrdersAwaiting
{
return $this->ordersAwaiting;
}
public function setOrdersAwaiting(OrdersAwaiting $ordersAwaiting): self
{
$this->ordersAwaiting = $ordersAwaiting;
// set the owning side of the relation if necessary
if ($ordersAwaiting->getOrderPart() !== $this) {
$ordersAwaiting->setOrderPart($this);
}
return $this;
}
public function hasCycle(): bool
{
/** @var OrderProductVariant $opv */
foreach ($this->getOrderProductVariant() as $opv)
{
if ($opv->getCycle())
{
return true;
}
}
return false;
}
public function getCycle(): ?OrderCycle
{
/** @var OrderProductVariant $opv */
foreach ($this->getOrderProductVariant() as $opv)
{
if ($opv->getCycle())
{
return $opv->getCycle();
}
}
return null;
}
public function createOrdTran(?string $ordTranPrefix)
{
if (!$ordTranPrefix)
$ordTranPrefix = 'WF';
$hash = md5($this->getId() . '-' . $this->getOrders()->getPortalSettings()->getId());
$hash = substr($hash, strlen($hash) - 5);
if ($ordTranPrefix === 'UK' || $ordTranPrefix === 'MNT')
{
$hash = $ordTranPrefix . $this->getId() . '-' . $hash;
}
else
{
$hash = $ordTranPrefix . $this->getId() . '-' . $this->getOrders()->getPortalSettings()->getId() . '-' . $hash;
}
$this->setOrdTran($hash);
}
public function getDateNextInvoice(): ?\DateTimeInterface
{
return $this->dateNextInvoice;
}
public function setDateNextInvoice(?\DateTimeInterface $dateNextInvoice): self
{
$this->dateNextInvoice = $dateNextInvoice;
return $this;
}
public function hasAnnualSubscription(): bool
{
/** @var OrderProductVariant $opv */
foreach ($this->getOrderProductVariant() as $opv)
{
if (strpos(strtolower($opv->getProductVariant()->getTradeName()), 'abonament roczny') !== false)
{
return true;
}
}
return false;
}
public function getNewOrdersCreatedFromTrial(): ?Orders
{
return $this->newOrdersCreatedFromTrial;
}
public function setNewOrdersCreatedFromTrial(?Orders $newOrdersCreatedFromTrial): self
{
$this->newOrdersCreatedFromTrial = $newOrdersCreatedFromTrial;
return $this;
}
/**
* @return Collection|CancellationFoResponse[]
*/
public function getCancellationFoResponses(): Collection
{
return $this->cancellationFoResponses;
}
public function addCancellationFoResponse(CancellationFoResponse $cancellationFoResponse): self
{
if (!$this->cancellationFoResponses->contains($cancellationFoResponse)) {
$this->cancellationFoResponses[] = $cancellationFoResponse;
$cancellationFoResponse->setOrderPart($this);
}
return $this;
}
public function removeCancellationFoResponse(CancellationFoResponse $cancellationFoResponse): self
{
if ($this->cancellationFoResponses->contains($cancellationFoResponse)) {
$this->cancellationFoResponses->removeElement($cancellationFoResponse);
// set the owning side to null (unless already changed)
if ($cancellationFoResponse->getOrderPart() === $this) {
$cancellationFoResponse->setOrderPart(null);
}
}
return $this;
}
/**
* @return Collection|VirtualCurrencyTransaction[]
*/
public function getVirtualCurrencyTransactions(): Collection
{
return $this->virtualCurrencyTransactions;
}
public function addVirtualCurrencyTransaction(VirtualCurrencyTransaction $virtualCurrencyTransaction): self
{
if (!$this->virtualCurrencyTransactions->contains($virtualCurrencyTransaction)) {
$this->virtualCurrencyTransactions[] = $virtualCurrencyTransaction;
$virtualCurrencyTransaction->setOrderPart($this);
}
return $this;
}
public function removeVirtualCurrencyTransaction(VirtualCurrencyTransaction $virtualCurrencyTransaction): self
{
if ($this->virtualCurrencyTransactions->contains($virtualCurrencyTransaction)) {
$this->virtualCurrencyTransactions->removeElement($virtualCurrencyTransaction);
// set the owning side to null (unless already changed)
if ($virtualCurrencyTransaction->getOrderPart() === $this) {
$virtualCurrencyTransaction->setOrderPart(null);
}
}
return $this;
}
public function getIsPaid(): ?bool
{
return $this->isPaid;
}
public function setIsPaid(bool $isPaid): self
{
$this->isPaid = $isPaid;
return $this;
}
public function getPaymentVerifiedOn(): ?string
{
return $this->paymentVerifiedOn;
}
public function setPaymentVerifiedOn(?string $paymentVerifiedOn): self
{
$this->paymentVerifiedOn = $paymentVerifiedOn;
return $this;
}
/**
* @return Collection|UserCertificate[]
*/
public function getUserCertificates(): Collection
{
return $this->userCertificates;
}
public function addUserCertificate(UserCertificate $userCertificate): self
{
if (!$this->userCertificates->contains($userCertificate)) {
$this->userCertificates[] = $userCertificate;
$userCertificate->setOrderPart($this);
}
return $this;
}
public function removeUserCertificate(UserCertificate $userCertificate): self
{
if ($this->userCertificates->contains($userCertificate)) {
$this->userCertificates->removeElement($userCertificate);
// set the owning side to null (unless already changed)
if ($userCertificate->getOrderPart() === $this) {
$userCertificate->setOrderPart(null);
}
}
return $this;
}
/**
* @return Collection|NewCardTokenRequest[]
*/
public function getNewCardTokenRequests(): Collection
{
return $this->newCardTokenRequests;
}
public function addNewCardTokenRequest(NewCardTokenRequest $newCardTokenRequest): self
{
if (!$this->newCardTokenRequests->contains($newCardTokenRequest)) {
$this->newCardTokenRequests[] = $newCardTokenRequest;
$newCardTokenRequest->setOrderPart($this);
}
return $this;
}
public function removeNewCardTokenRequest(NewCardTokenRequest $newCardTokenRequest): self
{
if ($this->newCardTokenRequests->contains($newCardTokenRequest)) {
$this->newCardTokenRequests->removeElement($newCardTokenRequest);
// set the owning side to null (unless already changed)
if ($newCardTokenRequest->getOrderPart() === $this) {
$newCardTokenRequest->setOrderPart(null);
}
}
return $this;
}
}