Drest\Service::setUpAndRunRequest PHP Method

setUpAndRunRequest() public method

Set up and run the required call method
public setUpAndRunRequest ( )
    public function setUpAndRunRequest()
    {
        if ($this->setupRequest()) {
            $this->runCallMethod();
        }
    }

Usage Example

示例#1
0
文件: Manager.php 项目: jdrich/drest
 /**
  * Execute a dispatched request
  * @throws Route\NoMatchException|\Exception
  */
 protected function execute()
 {
     if (($route = $this->determineRoute()) instanceof RouteMetaData) {
         // Set the matched service object and the error handler into the service class
         $this->service->setMatchedRoute($route);
         // Get the representation to be used - always successful or it throws an exception
         $this->service->setRepresentation($this->representationManager->handleExposureSettingsFromHttpMethod($this->getRequest(), $route, $this->emr));
         $this->service->setErrorHandler($this->getErrorHandler());
         // Set up the service for a new request
         $this->service->setUpAndRunRequest();
     }
 }