src/Entity/OnlineShop/FamilyNoLinealDiscount.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity\OnlineShop;
  3. use App\Entity\AbstractBase;
  4. use App\Entity\MiniAbstractBase;
  5. use App\Entity\Traits\DescriptionTrait;
  6. use App\Enum\UnitEnum;
  7. use App\Repository\OnlineShop\FamilyNoLinealDiscountRepository;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Gedmo\Mapping\Annotation as Gedmo;
  10. /**
  11.  * @ORM\Table(name="vulco_no_lineal_discount")
  12.  * @ORM\Entity(repositoryClass=FamilyNoLinealDiscountRepository::class)
  13.  * @Gedmo\SoftDeleteable(fieldName="removedAt", timeAware=false)
  14.  */
  15. class FamilyNoLinealDiscount extends AbstractBase
  16. {
  17.     use DescriptionTrait;
  18.     /**
  19.      * @ORM\Column(type="text", length=10000, nullable=true)
  20.      */
  21.     private ?string $description null;
  22.     /**
  23.      * @ORM\Column(type="integer")
  24.      */
  25.     private int $unit UnitEnum::UNIT;
  26.     /**
  27.      * @ORM\Column(type="boolean", nullable=false, options={"default": 0})
  28.      */
  29.     private bool $enabled false;
  30.     public function getUnit(): int
  31.     {
  32.         return $this->unit;
  33.     }
  34.     public function setUnit(int $unit): self
  35.     {
  36.         $this->unit $unit;
  37.         return $this;
  38.     }
  39.     public function getEnabled(): bool
  40.     {
  41.         return $this->enabled;
  42.     }
  43.     public function isEnabled(): bool
  44.     {
  45.         return $this->getEnabled();
  46.     }
  47.     public function setEnabled(bool $enabled): self
  48.     {
  49.         $this->enabled $enabled;
  50.         return $this;
  51.     }
  52.     public function __toString(): string
  53.     {
  54.         return $this->description $this->getDescription() : MiniAbstractBase::DEFAULT_EMPTY_STRING;
  55.     }
  56. }