Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace My\Bundle\Entity\Post;
- use Doctrine\ORM\Mapping as ORM;
- /**
- * Gallery
- *
- * @ORM\Table()
- * @ORM\Entity
- */
- class Gallery
- {
- /**
- * @var integer
- *
- * @ORM\Column(name="id", type="integer")
- * @ORM\Id
- * @ORM\GeneratedValue(strategy="AUTO")
- */
- private $id;
- /**
- * @var string
- *
- * @ORM\Column(name="name", type="string", length=255)
- */
- private $name;
- /**
- * @ORM\OneToMany(targetEntity="GalleryImage", mappedBy="gallery", cascade={"persist"})
- */
- private $images;
- /**
- * Get id
- *
- * @return integer
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Set name
- *
- * @param string $name
- * @return Gallery
- */
- public function setName($name)
- {
- $this->name = $name;
- return $this;
- }
- /**
- * Get name
- *
- * @return string
- */
- public function getName()
- {
- return $this->name;
- }
- /**
- * Constructor
- */
- public function __construct()
- {
- $this->images = new \Doctrine\Common\Collections\ArrayCollection();
- }
- /**
- * Add images
- *
- * @param \My\Bundle\Entity\Post\GalleryImage $images
- * @return Gallery
- */
- public function addImage(\My\Bundle\Entity\Post\GalleryImage $images)
- {
- $this->images[] = $images;
- $images->setGallery($this);
- return $this;
- }
- /**
- * Remove images
- *
- * @param \My\Bundle\Entity\Post\GalleryImage $images
- */
- public function removeImage(\My\Bundle\Entity\Post\GalleryImage $images)
- {
- $this->images->removeElement($images);
- }
- /**
- * Get images
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getImages()
- {
- return $this->images;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement