/** * {@inheritDoc} */ public function encodeUrl() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'encodeUrl', array()); return parent::encodeUrl(); }
/** * Get the gallery url * * @param \Image\Entity\Gallery $gallery * @return string */ private function getGalleryUrl($gallery) { $encodedUrl = $gallery->encodeUrl(); $galleries = $this->getGalleryRepository()->findBy(array("url" => $encodedUrl)); return count($galleries) > 0 ? $encodedUrl . '-' . (count($galleries) + 1) : $encodedUrl; }