PhalconRest\Api\ApiEndpoint::getHandlerMethod PHP Méthode

getHandlerMethod() public méthode

public getHandlerMethod ( ) : string
Résultat string Name of controller-method to be called for the endpoint
    public function getHandlerMethod()
    {
        return $this->handlerMethod;
    }

Usage Example

 /**
  * Mounts endpoint to the collection
  *
  * @param \PhalconRest\Api\ApiEndpoint $endpoint Endpoint to mount
  *
  * @return static
  */
 public function endpoint(ApiEndpoint $endpoint)
 {
     $this->endpointsByName[$endpoint->getName()] = $endpoint;
     switch ($endpoint->getHttpMethod()) {
         case HttpMethods::GET:
             $this->get($endpoint->getPath(), $endpoint->getHandlerMethod(), $this->createRouteName($endpoint));
             break;
         case HttpMethods::POST:
             $this->post($endpoint->getPath(), $endpoint->getHandlerMethod(), $this->createRouteName($endpoint));
             break;
         case HttpMethods::PUT:
             $this->put($endpoint->getPath(), $endpoint->getHandlerMethod(), $this->createRouteName($endpoint));
             break;
         case HttpMethods::DELETE:
             $this->delete($endpoint->getPath(), $endpoint->getHandlerMethod(), $this->createRouteName($endpoint));
             break;
     }
     return $this;
 }