Drest\Mapping\RouteMetaData::getExpose PHP Method

getExpose() public method

Get the field exposure on this route
public getExpose ( ) : array
return array $expose
    public function getExpose()
    {
        return $this->expose;
    }

Usage Example

Example #1
0
 /**
  * Called on successful routing of a service call
  * Prepares the service to a request to be rendered
  *
  * @return boolean $result - if false then fail fast no call to runCallMethod() should be made.
  */
 public function setupRequest()
 {
     // Make sure we have a route matched (this should caught and an exception thrown on Manager::determineRoute())
     if (!$this->matched_route instanceof RouteMetaData) {
         return false;
     }
     // If its a GET request and no expose fields are present, fail early
     $expose = $this->matched_route->getExpose();
     if ($this->getRequest()->getHttpMethod() == Request::METHOD_GET && (empty($expose) || sizeof($expose) == 1 && empty($expose[0]))) {
         $this->renderDeterminedRepresentation($this->getActionInstance()->createResultSet(array()));
         return false;
     }
     return true;
 }
All Usage Examples Of Drest\Mapping\RouteMetaData::getExpose