|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- <?php
-
- namespace Lc\CaracoleBundle\Model\Config;
-
- use Doctrine\ORM\Mapping as ORM;
- use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;
-
- /**
- * @ORM\MappedSuperclass
- */
- abstract class UnitModel extends AbstractLightEntity implements UnitInterface
- {
-
- const UNIT_PERCENT = 'percent';
- const UNIT_AMOUNT = 'amount';
-
-
- public function getUnitAmountChoices(): array
- {
- return [
- self::UNIT_PERCENT,
- self::UNIT_AMOUNT,
- ];
- }
-
- /**
- * @ORM\Column(type="string", length=32)
- */
- protected $unit;
-
- /**
- * @ORM\Column(type="string", length=32)
- */
- protected $wording;
-
- /**
- * @ORM\Column(type="string", length=32)
- */
- protected $wordingUnit;
-
- /**
- * @ORM\Column(type="string", length=32)
- */
- protected $wordingShort;
-
- /**
- * @ORM\Column(type="integer")
- */
- protected $coefficient;
-
- /**
- * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Config\UnitInterface")
- * @ORM\JoinColumn(nullable=true)
- */
- protected $unitReference;
-
- public function __toString()
- {
- return $this->getWording();
- }
-
- public function getUnit(): ?string
- {
- return $this->unit;
- }
-
- public function setUnit(string $unit): self
- {
- $this->unit = $unit;
-
- return $this;
- }
-
- public function getWording(): ?string
- {
- return $this->wording;
- }
-
- public function setWording(string $wording): self
- {
- $this->wording = $wording;
-
- return $this;
- }
-
- public function getWordingUnit(): ?string
- {
- return $this->wordingUnit;
- }
-
- public function setWordingUnit(string $wordingUnit): self
- {
- $this->wordingUnit = $wordingUnit;
-
- return $this;
- }
-
- public function getWordingShort(): ?string
- {
- return $this->wordingShort;
- }
-
- public function setWordingShort(string $wordingShort): self
- {
- $this->wordingShort = $wordingShort;
-
- return $this;
- }
-
- public function getCoefficient(): ?int
- {
- return $this->coefficient;
- }
-
- public function setCoefficient(int $coefficient): self
- {
- $this->coefficient = $coefficient;
-
- return $this;
- }
-
- public function getUnitReference(): ?self
- {
- return $this->unitReference;
- }
-
- public function setUnitReference(?UnitInterface $unitReference): self
- {
- $this->unitReference = $unitReference;
-
- return $this;
- }
- }
|