<?phpnamespace App\Entity;use App\Entity\SonataClassificationTag;use App\Application\Sonata\MediaBundle\Entity\Media;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * DocumentCompanyRights * * @ORM\Table(name="key_benefit") * @ORM\Entity(repositoryClass="App\Repository\KeyBenefitRepository") */class KeyBenefit{ const PROP_UID = 'uid'; /** * @var int * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @ORM\ManyToOne(targetEntity="App\Entity\Product", inversedBy="keyBenefits") * @ORM\JoinColumn(name="product_id", referencedColumnName="id") */ private $product; /** * @ORM\Column(name="title", type="string", length=255) */ private $title = ""; /** * @ORM\Column(name="description", type="text") */ private $description; /** * @ORM\OneToOne(targetEntity="App\Application\Sonata\MediaBundle\Entity\Media", cascade={"persist"}) */ private $image; /** * @ORM\ManyToMany(targetEntity="App\Entity\SonataClassificationTag") */ private $userProfile; /** * @var int * @ORM\Column(name="position", type="integer") */ private $position; /** * Constructor */ public function __construct() { $this->userProfile = new ArrayCollection(); } public function toString(): string { return "{id=" . $this->id . "}"; } /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Get title * * @return string */ public function getTitle() { return $this->title; } /** * Set title * * @param string $title * * @return KeyBenefit */ public function setTitle($title) { $this->title = $title; return $this; } /** * Get description * * @return string */ public function getDescription() { return $this->description; } /** * Set description * * @param string $description * * @return KeyBenefit */ public function setDescription($description) { $this->description = $description; return $this; } /** * Get image * * @return Media */ public function getImage(): ?Media { return $this->image; } /** * Set image * * @param Media $image * * @return KeyBenefit */ public function setImage(Media $image = null) { $this->image = $image; return $this; } /** * Get product * * @return Product */ public function getProduct() { return $this->product; } /** * Set product * * @param Product $product * * @return KeyBenefit */ public function setProduct(Product $product = null) { $this->product = $product; return $this; } /** * Add userProfile * * @param SonataClassificationTag $userProfile * * @return KeyBenefit */ public function addUserProfile(SonataClassificationTag $userProfile) { $this->userProfile[] = $userProfile; return $this; } /** * Remove userProfile * * @param SonataClassificationTag $userProfile */ public function removeUserProfile(SonataClassificationTag $userProfile) { $this->userProfile->removeElement($userProfile); } /** * Get userProfile * * @return Collection */ public function getUserProfile() { return $this->userProfile; } /** * Get position * * @return integer */ public function getPosition() { return $this->position; } /** * Set position * * @param integer $position * * @return KeyBenefit */ public function setPosition($position) { $this->position = $position; return $this; }}