true])] #[Assert\Type(type: 'boolean')] #[Assert\NotNull] #[Groups(['intangiblepriceanddiscount', 'educational_project_intangible_list_intangiblepriceanddiscount', 'access_intangible_list_intangiblepriceanddiscount', 'intangible_list_intangiblepriceanddiscount', 'access_intangible_list_intangible'])] private $applyDiscount = true; /** * @var ArrayCollection */ #[Assert\Valid] #[ORM\OneToMany(targetEntity: 'IntangibleDiscountDetail', mappedBy: 'intangiblePriceAndDiscount', cascade: ['persist'], orphanRemoval: true)] #[Groups(['intangiblepriceanddiscount_intangiblediscountdetail'])] private $intangibleDiscountDetails; /** * @var float */ #[ORM\Column(type: 'float', nullable: true)] #[Assert\Type(type: 'float')] #[Groups(['intangiblepriceanddiscount', 'educational_project_intangible_list_intangiblepriceanddiscount', 'access_intangible_list_intangiblepriceanddiscount'])] private $price; /** * @var bool */ #[ORM\Column(type: 'boolean', options: ['default' => true])] #[Assert\Type(type: 'boolean')] #[Assert\NotNull] #[Groups(['intangiblepriceanddiscount'])] private $automaticDiscountCalculation = true; /** * 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; } /** * Constructor */ public function __construct() { $this->intangibleDiscountDetail = new ArrayCollection(); } /** * Set amountType * * @param string $amountType * * @return IntangiblePriceAndDiscount */ public function setAmountType($amountType) { $this->amountType = $amountType; return $this; } /** * Get amountType * * @return string */ public function getAmountType() { return $this->amountType; } /** * Set applyDiscount * * @param boolean $applyDiscount * * @return IntangiblePriceAndDiscount */ public function setApplyDiscount($applyDiscount) { $this->applyDiscount = $applyDiscount; return $this; } /** * Get applyDiscount * * @return boolean */ public function getApplyDiscount() { return $this->applyDiscount; } /** * Set price * * @param float $price * * @return IntangiblePriceAndDiscount */ public function setPrice($price) { $this->price = floatval($price); return $this; } /** * Get price * * @return float */ public function getPrice() { return $this->price; } /** * Add intangibleDiscountDetail * * @param \AppBundle\Entity\Product\IntangibleDiscountDetail $intangibleDiscountDetail * * @return IntangiblePriceAndDiscount */ public function addIntangibleDiscountDetail(\AppBundle\Entity\Product\IntangibleDiscountDetail $intangibleDiscountDetail) { $intangibleDiscountDetail->setIntangiblePriceAndDiscount($this); $this->intangibleDiscountDetails[] = $intangibleDiscountDetail; return $this; } /** * Remove intangibleDiscountDetail * * @param \AppBundle\Entity\Product\IntangibleDiscountDetail $intangibleDiscountDetail */ public function removeIntangibleDiscountDetail(\AppBundle\Entity\Product\IntangibleDiscountDetail $intangibleDiscountDetail) { $this->intangibleDiscountDetails->removeElement($intangibleDiscountDetail); } /** * Get intangibleDiscountDetails * * @return \Doctrine\Common\Collections\Collection */ public function getIntangibleDiscountDetails() { return $this->intangibleDiscountDetails; } /** * Set automaticDiscountCalculation * * @param boolean $automaticDiscountCalculation * * @return IntangiblePriceAndDiscount */ public function setAutomaticDiscountCalculation($automaticDiscountCalculation) { $this->automaticDiscountCalculation = $automaticDiscountCalculation; return $this; } /** * Get automaticDiscountCalculation * * @return boolean */ public function getAutomaticDiscountCalculation() { return $this->automaticDiscountCalculation; } }