public function newGallery(GalleryAdapter $gallery = null)
    {
        if (empty($gallery)) {
            $class   = $this->getNamespaceService() . 'Gallery';
            $gallery = new $class;
        }

        if (! empty($this->plugins)) {
            array_walk($this->plugins, [$gallery, 'addPlugin']);
        }

        return $gallery;

    }
public function newGallery(GalleryAdapter $gallery = null)
    {
        if (empty($gallery)) {
            $class   = $this->getNamespaceService() . 'Gallery';
            $gallery = new $class;
        }

        if (! empty($this->plugins)) {
            array_walk($this->plugins, [$gallery, 'addPlugin']);
        }

        return $gallery;

    }
public function newGallery ( GalleryAdapter $ gallery = null ) { if ( empty ( $ gallery ) ) { $ class = $ this -> getNamespaceService ( ) . 'Gallery' ; $ gallery = new $ class ; } if ( ! empty ( $ this -> plugins ) ) { array_walk ( $ this -> plugins , [ $ gallery , 'addPlugin' ] ) ; } return $ gallery ; }
This method create a new service gallery object to interact with the external api service.

@return RestGalleries\APIs\<service>\Gallery
This method create a new service gallery object to interact with the external api service .