Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Form:
- <f:form.upload property="images" id="images" additionalAttributes="{multiple:multiple}" />
- Model:
- /**
- * The images of this gallery
- *
- * @var \Doctrine\Common\Collections\Collection<\Foo\Bar\Domain\Model\Image>
- * @ORM\OneToMany(mappedBy="gallery", cascade={"all"}, orphanRemoval=true)
- */
- protected $images;
- /**
- * Returns all content belonging to this page
- *
- * @return \Doctrine\Common\Collections\Collection<\Foo\Bar\Domain\Model\Image> image
- */
- public function getImages() {
- return $this->images;
- }
- /**
- * @param \Doctrine\Common\Collections\Collection $images
- * @return void
- */
- public function setImages(\Doctrine\Common\Collections\Collection $images) {
- $this->images = $images;
- }
- /**
- * @param \Foo\Bar\Domain\Model\Image $image
- * @return void
- */
- public function addImage(\Foo\Bar\Domain\Model\Image$image) {
- $this->images->add($image);
- }
- /**
- * @param \Foo\Bar\Domain\Model\Image $image
- * @return void
- */
- public function removeImage(\Foo\Bar\Domain\Model\Image$image) {
- $this->images->removeElement($image);
- }
Advertisement
Add Comment
Please, Sign In to add comment