Entity/Gallery.php
public function addMedia(Media $media)
	{
		$this->media[] = $media;
		$media->addGallery($this);

		return $this;
	}
public function addMedia(Media $media)
	{
		$this->media[] = $media;
		$media->addGallery($this);

		return $this;
	}
public function addMedia ( Media $ media ) { $ this -> media [ ] = $ media ; $ media -> addGallery ( $ this ) ; return $ this ; }
Add media to gallery

@param Media $media
@return Gallery
Add media to gallery