src/Entity/KeyBenefit.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\SonataClassificationTag;
  4. use App\Application\Sonata\MediaBundle\Entity\Media;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * DocumentCompanyRights
  10.  *
  11.  * @ORM\Table(name="key_benefit")
  12.  * @ORM\Entity(repositoryClass="App\Repository\KeyBenefitRepository")
  13.  */
  14. class KeyBenefit
  15. {
  16.     const PROP_UID 'uid';
  17.     /**
  18.      * @var int
  19.      *
  20.      * @ORM\Column(name="id", type="integer")
  21.      * @ORM\Id
  22.      * @ORM\GeneratedValue(strategy="AUTO")
  23.      */
  24.     private $id;
  25.     /**
  26.      * @ORM\ManyToOne(targetEntity="App\Entity\Product", inversedBy="keyBenefits")
  27.      * @ORM\JoinColumn(name="product_id", referencedColumnName="id")
  28.      */
  29.     private $product;
  30.     /**
  31.      * @ORM\Column(name="title", type="string", length=255)
  32.      */
  33.     private $title "";
  34.     /**
  35.      * @ORM\Column(name="description", type="text")
  36.      */
  37.     private $description;
  38.     /**
  39.      * @ORM\OneToOne(targetEntity="App\Application\Sonata\MediaBundle\Entity\Media", cascade={"persist"})
  40.      */
  41.     private $image;
  42.     /**
  43.      * @ORM\ManyToMany(targetEntity="App\Entity\SonataClassificationTag")
  44.      */
  45.     private $userProfile;
  46.     /**
  47.      * @var int
  48.      * @ORM\Column(name="position", type="integer")
  49.      */
  50.     private $position;
  51.     /**
  52.      * Constructor
  53.      */
  54.     public function __construct()
  55.     {
  56.         $this->userProfile = new ArrayCollection();
  57.     }
  58.     public function toString(): string
  59.     {
  60.         return "{id=" $this->id "}";
  61.     }
  62.     /**
  63.      * Get id
  64.      *
  65.      * @return integer
  66.      */
  67.     public function getId()
  68.     {
  69.         return $this->id;
  70.     }
  71.     /**
  72.      * Get title
  73.      *
  74.      * @return string
  75.      */
  76.     public function getTitle()
  77.     {
  78.         return $this->title;
  79.     }
  80.     /**
  81.      * Set title
  82.      *
  83.      * @param string $title
  84.      *
  85.      * @return KeyBenefit
  86.      */
  87.     public function setTitle($title)
  88.     {
  89.         $this->title $title;
  90.         return $this;
  91.     }
  92.     /**
  93.      * Get description
  94.      *
  95.      * @return string
  96.      */
  97.     public function getDescription()
  98.     {
  99.         return $this->description;
  100.     }
  101.     /**
  102.      * Set description
  103.      *
  104.      * @param string $description
  105.      *
  106.      * @return KeyBenefit
  107.      */
  108.     public function setDescription($description)
  109.     {
  110.         $this->description $description;
  111.         return $this;
  112.     }
  113.     /**
  114.      * Get image
  115.      *
  116.      * @return Media
  117.      */
  118.     public function getImage(): ?Media
  119.     {
  120.         return $this->image;
  121.     }
  122.     /**
  123.      * Set image
  124.      *
  125.      * @param Media $image
  126.      *
  127.      * @return KeyBenefit
  128.      */
  129.     public function setImage(Media $image null)
  130.     {
  131.         $this->image $image;
  132.         return $this;
  133.     }
  134.     /**
  135.      * Get product
  136.      *
  137.      * @return Product
  138.      */
  139.     public function getProduct()
  140.     {
  141.         return $this->product;
  142.     }
  143.     /**
  144.      * Set product
  145.      *
  146.      * @param Product $product
  147.      *
  148.      * @return KeyBenefit
  149.      */
  150.     public function setProduct(Product $product null)
  151.     {
  152.         $this->product $product;
  153.         return $this;
  154.     }
  155.     /**
  156.      * Add userProfile
  157.      *
  158.      * @param SonataClassificationTag $userProfile
  159.      *
  160.      * @return KeyBenefit
  161.      */
  162.     public function addUserProfile(SonataClassificationTag $userProfile)
  163.     {
  164.         $this->userProfile[] = $userProfile;
  165.         return $this;
  166.     }
  167.     /**
  168.      * Remove userProfile
  169.      *
  170.      * @param SonataClassificationTag $userProfile
  171.      */
  172.     public function removeUserProfile(SonataClassificationTag $userProfile)
  173.     {
  174.         $this->userProfile->removeElement($userProfile);
  175.     }
  176.     /**
  177.      * Get userProfile
  178.      *
  179.      * @return Collection
  180.      */
  181.     public function getUserProfile()
  182.     {
  183.         return $this->userProfile;
  184.     }
  185.     /**
  186.      * Get position
  187.      *
  188.      * @return integer
  189.      */
  190.     public function getPosition()
  191.     {
  192.         return $this->position;
  193.     }
  194.     /**
  195.      * Set position
  196.      *
  197.      * @param integer $position
  198.      *
  199.      * @return KeyBenefit
  200.      */
  201.     public function setPosition($position)
  202.     {
  203.         $this->position $position;
  204.         return $this;
  205.     }
  206. }