protected function _slugExists($slug, ServerRequest $request)
    {
        $existingSlug = $this->find('all')
            ->select($this->getAlias() . '.slug')
            ->where([
                $this->getAlias() . '.slug' => $slug,
                $this->getAlias() . '.controller' => $request->getParam('controller'),
                $this->getAlias() . '.action' => $request->getParam('action')
            ])
            ->where($this->_pluginCondition($request))
            ->enableHydration(false)
            ->first();

        return $existingSlug !== null;
    }
protected function _slugExists($slug, ServerRequest $request)
    {
        $existingSlug = $this->find('all')
            ->select($this->getAlias() . '.slug')
            ->where([
                $this->getAlias() . '.slug' => $slug,
                $this->getAlias() . '.controller' => $request->getParam('controller'),
                $this->getAlias() . '.action' => $request->getParam('action')
            ])
            ->where($this->_pluginCondition($request))
            ->enableHydration(false)
            ->first();

        return $existingSlug !== null;
    }
protected function _slugExists ( $ slug , ServerRequest $ request ) { $ existingSlug = $ this -> find ( 'all' ) -> select ( $ this -> getAlias ( ) . '.slug' ) -> where ( [ $ this -> getAlias ( ) . '.slug' => $ slug , $ this -> getAlias ( ) . '.controller' => $ request -> getParam ( 'controller' ) , $ this -> getAlias ( ) . '.action' => $ request -> getParam ( 'action' ) ] ) -> where ( $ this -> _pluginCondition ( $ request ) ) -> enableHydration ( false ) -> first ( ) ; return $ existingSlug !== null ; }
Check if a slug for the given request params already exists.

@param string $slug
@param ServerRequest $request
@return bool
Check if a slug for the given request params already exists .