Example #1
0
 /**
  * @param Route $route
  * @param $parameter
  */
 function run(Route $route)
 {
     $routeUrlParameter = $this->getRouteUrlParameter();
     switch ($route->getActionName()) {
         case 'listUsers':
             $this->listUsers();
             break;
         case 'editUser':
             $this->editUser($routeUrlParameter);
             break;
         case 'createUser':
             $this->createUser();
             break;
         case 'deleteUser':
             $this->deleteUser($routeUrlParameter);
             break;
     }
 }
Example #2
0
 /**
  * @return null|Endpoint
  */
 private function getCalledEnpoint()
 {
     foreach ($this->_enpoints as $endpoint) {
         /** @var Endpoint $endpoint */
         $activeRoute = $endpoint->isActiveRoute($this->_endpointPath, $this->_pathInfo, Route::getHtmlMethodCode($this->_requestMethod));
         if ($activeRoute) {
             return $endpoint;
         }
     }
     return null;
 }