src/Entity/PointsCatalog/CatalogConversionFormula.php line 24

Open in your IDE?
  1. <?php
  2. namespace App\Entity\PointsCatalog;
  3. use App\Annotation\SiteAware;
  4. use App\Entity\AbstractBase;
  5. use App\Entity\Interfaces\SiteInterface;
  6. use App\Entity\MiniAbstractBase;
  7. use App\Entity\Traits\DescriptionTrait;
  8. use App\Entity\Traits\NameTrait;
  9. use App\Entity\Traits\PublishedTrait;
  10. use App\Entity\Traits\SiteTrait;
  11. use App\Repository\PointsCatalog\CatalogConversionFormulaRepository;
  12. use Doctrine\ORM\Mapping as ORM;
  13. use Gedmo\Mapping\Annotation as Gedmo;
  14. use Symfony\Component\Validator\Constraints as Assert;
  15. /**
  16.  * @ORM\Table(name="vulco_points_catalog_conversion_formula", indexes={@ORM\Index(name="catalog_conversion_formula_site_idx", columns={"site"})})
  17.  * @ORM\Entity(repositoryClass=CatalogConversionFormulaRepository::class)
  18.  * @Gedmo\SoftDeleteable(fieldName="removedAt", timeAware=false)
  19.  * @SiteAware(siteFieldName="site")
  20.  */
  21. class CatalogConversionFormula extends AbstractBase implements SiteInterface
  22. {
  23.     use DescriptionTrait;
  24.     use NameTrait;
  25.     use PublishedTrait;
  26.     use SiteTrait;
  27.     /**
  28.      * @ORM\Column(type="string", length=255, nullable=false)
  29.      * @Assert\NotBlank()
  30.      */
  31.     private string $name;
  32.     /**
  33.      * @ORM\Column(type="text", length=10000, nullable=true)
  34.      */
  35.     private ?string $description null;
  36.     /**
  37.      * @ORM\Column(type="float", nullable=false)
  38.      * @Assert\NotBlank()
  39.      */
  40.     private float $ratio;
  41.     public function getRatio(): float
  42.     {
  43.         return $this->ratio;
  44.     }
  45.     public function setRatio(float $ratio): self
  46.     {
  47.         $this->ratio $ratio;
  48.         return $this;
  49.     }
  50.     public function __toString(): string
  51.     {
  52.         return $this->name $this->getName() : MiniAbstractBase::DEFAULT_EMPTY_STRING;
  53.     }
  54. }