You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- <?php
-
- namespace Lc\CaracoleBundle\Model\Order;
-
- use Doctrine\ORM\Mapping as ORM;
- use Lc\CaracoleBundle\Doctrine\Extension\ReductionTrait;
-
- /**
- * @ORM\MappedSuperclass()
- */
- abstract class OrderProductReductionCatalogModel
- {
- use ReductionTrait;
-
- /**
- * @ORM\Column(type="string", length=255)
- */
- protected $title;
-
- public function getTitle(): ?string
- {
- return $this->title;
- }
-
- public function setTitle(string $title): self
- {
- $this->title = $title;
-
- return $this;
- }
-
- // getSummaryOrderProductReductionCatalog
- public function getSummary()
- {
- $text = '';
-
- if ($this->getUnit() == 'amount') {
- $text .= '- ' . $this->getValue() . ' €';
- }
-
- if ($this->getUnit() == 'percent') {
- $text .= '- ' . $this->getValue() . ' %';
- }
-
- return $text;
- }
-
- // compareOrderProductReductionCatalog
- public function compare($orderProductReductionCatalog)
- {
- return $orderProductReductionCatalog
- && $this->getUnit() == $orderProductReductionCatalog->getUnit()
- && (string)$this->getValue() == (string)$orderProductReductionCatalog->getValue()
- && $this->getBehaviorTaxRate() == $orderProductReductionCatalog->getBehaviorTaxRate();
- }
- }
|