public function checkOptions(MvcEvent $e)
    {
        $matches  = $e->getRouteMatch();
        $response = $e->getResponse();
        $request  = $e->getRequest();
        $method   = $request->getMethod();

        // test if we matched an individual resource, and then test
        // if we allow the particular request method
        if ($matches->getParam('id', false)) {
            if (!in_array($method, $this->allowedResourceMethods)) {
                $response->setStatusCode(405);
                return $response;
            }
            return;
        }

        // We matched a collection; test if we allow the particular request 
        // method
        if (!in_array($method, $this->allowedCollectionMethods)) {
            $response->setStatusCode(405);
            return $response;
        }
    }
public function checkOptions(MvcEvent $e)
    {
        $matches  = $e->getRouteMatch();
        $response = $e->getResponse();
        $request  = $e->getRequest();
        $method   = $request->getMethod();

        // test if we matched an individual resource, and then test
        // if we allow the particular request method
        if ($matches->getParam('id', false)) {
            if (!in_array($method, $this->allowedResourceMethods)) {
                $response->setStatusCode(405);
                return $response;
            }
            return;
        }

        // We matched a collection; test if we allow the particular request 
        // method
        if (!in_array($method, $this->allowedCollectionMethods)) {
            $response->setStatusCode(405);
            return $response;
        }
    }
public function checkOptions ( MvcEvent $ e ) { $ matches = $ e -> getRouteMatch ( ) ; $ response = $ e -> getResponse ( ) ; $ request = $ e -> getRequest ( ) ; $ method = $ request -> getMethod ( ) ; // test if we matched an individual resource, and then test // if we allow the particular request method if ( $ matches -> getParam ( 'id' , false ) ) { if ( ! in_array ( $ method , $ this -> allowedResourceMethods ) ) { $ response -> setStatusCode ( 405 ) ; return $ response ; } return ; } // We matched a collection; test if we allow the particular request  // method if ( ! in_array ( $ method , $ this -> allowedCollectionMethods ) ) { $ response -> setStatusCode ( 405 ) ; return $ response ; } }
Checks that is an allowed method

@param Zend\Mvc\MvcEvent $e
@return void|Zend\Http\Response
Checks that is an allowed method