Set the Route

This function takes an array of URI segments as
input, and sets the current class/method

@access	private
@param	array
@param	bool
@return	void
491438
protected function _setRequest($segments = array()){
		$segments = $this->_validateRequest($segments);
		if (count($segments) == 0){
			return $this->uri->_reindex_segments();
		}

		$this->setClass($segments[0]);

		if (isset($segments[1]))
		{
			// A standard method request
			$this->method = $segments[1];
		}
		else
		{
			// This lets the "routed" segment array identify that the default
			// index method is being used.
			$segments[1] = 'index';
		}

		// Update our "routed" segment array to contain the segments.
		// Note: If there is no custom routing, this array will be
		// identical to $this->uri->segments
		$this->uri->rsegments = $segments;
	}
955725
public function setParams(array $params = null)
    {
        $this->params = $params;
        if (null !== $params && empty($params)) {
            $this->params = null;
        }
    }
1290641
public static function set($uri, $path = false)
    {
        $route = new \Ginger\Route($uri, $path);
        self::$routes[$route->route] = $route;
    }
423438
public function setRoutes(array $routes)
    {
        $toIterate = RouteConfig::defaultRouteTypes();
        foreach ($routes as $key => $val) {
            if (in_array($key, $toIterate) && isset($this->routes[$key])) {
                $this->routes[$key] = array_merge($this->routes[$key], $val);
            } else {
                $this->routes[$key] = $val;
            }
        }

        return $this;
    }
707485
protected function setAfterSendRoute()
    {
        if ($this->routeAction && ($this->request->getActionName() !== $this->routeAction)) {
            $this->afterSendRouteUrl = array('action' => $this->routeAction);

            $keys  = $this->model->getKeys();
            if (count($keys) == 1) {
                $key = reset($keys);
                if (isset($this->formData[$key])) {
                    $this->afterSendRouteUrl[\MUtil_Model::REQUEST_ID] = $this->formData[$key];
                }
            } else {
                $i = 1;
                foreach ($keys as $key) {
                    if (isset($this->formData[$key])) {
                        $this->afterSendRouteUrl[\MUtil_Model::REQUEST_ID . $i] = $this->formData[$key];
                    }
                    $i++;
                }
            }

            $this->afterSendRouteUrl['controller'] = $this->request->getControllerName();

            $find['action'] = $this->afterSendRouteUrl['action'];
            $find['controller'] = $this->afterSendRouteUrl['controller'];

            if (null == $this->menu->find($find)) {
                $this->afterSendRouteUrl['action'] = 'index';
                $this->resetRoute = true;
            }
        }
    }
1081395
public function setRequest(Request $request)
    {
        $this->request = $request;

        $this->cachedRoot = null;
        $this->cachedScheme = null;
        $this->routeGenerator = null;
    }
1131858
function setUrl( $value, $params=FALSE ) {
    $this->url['value']   = $value;
    if( empty( $this->url['value'] ))
      return;
    $this->url['params'] = $this->_setParams( $params );
  }
238614
protected function checkRoutesValidity(array $routes): void
    {
        $requiredRouteKeys = ['index'];
        $optionalRouteKeys = ['create', 'edit', 'destroy'];
        $allowedRouteKeys = array_merge($requiredRouteKeys, $optionalRouteKeys);
        $this->checkRequiredRoutesValidity($routes, $requiredRouteKeys);
        $this->checkAllowedRoutesValidity($routes, $allowedRouteKeys);
        $this->checkRoutesStructureValidity($routes);
    }
829983
public function setRoutes(array $routes) {

	    foreach($routes as $route) {

	        if(!$route instanceof Route) {
	            throw new \InvalidArgumentException(sprintf("'%s' is not a Route instance.", $route));
            }

            $this->addRoute($route);

        }

    }
802931
public function setRoutes() : void
    {
        if (is_null($this->routes)) {
            $this->routes = [];
            $routesConfig = $this->config->getParam('routes') ?? [];
            foreach ($routesConfig as $routeName => $routeArr) {
                $route = new Route(
                    $routeName,
                    $routeArr['methods'],
                    $routeArr['path'],
                    $routeArr['params_defaults'],
                    $routeArr['params_requirements'],
                    $routeArr['handler'],
                    $routeArr['handler_method'] ?? null
                );
                $this->routes[] = $route;
            }
        }
    }
858812
protected function setRequestUri(array $parameters = array())
    {
        // Getting base uri according to the uri construction method
        $uri = $this->constructActionUrl($parameters);

        // Converting it into a Zend Http Uri object
        $httpUri = new Http($uri);
        $httpUri->setPort($this->port);

        // Setting request uri object
        $this->setUri($httpUri);
    }
911039
public function setData($data = [])
    {
        if (!is_array($data) && is_string($data)) {
            $data = parse_str($data);
        }
        if (count($data) == 0) {
            $this->data = [];
        } else {
            $this->data = $data;
        }
        $this->debug->debug(__FUNCTION__, 'Data into Request: ', $this->data);
    }
131284
private function setAccessControllers(): void
    {
        $this->absolutePathToAccessControllers = [];
        $route = $this->routingBasePath;

        foreach ($this->getRealArgs() as $arg)
        {
            $route .= $arg . '/';
            $path = $route . 'access.php';

            if (\is_file($path)) {
                array_unshift($this->absolutePathToAccessControllers, $path);
                break;
            }
        }
    }
1041448
public function setData(array $request = []) {
        unset($this->parameters);
        unset($this->path);
        unset($this->pathParts);
        $_REQUEST = $request;
    }
386868
function route(
    $path = '/', $actions, $method = Router::ANY_METHOD, $name = null, array $filters = [], array $events = []
    )
    {
        if (is_array($path)) {
            foreach ($path as $p) {
                $this->collection[$name ?: count($this->collection)] = (new Route($this->Parser))
                        ->route($p, is_array($actions) ? $actions : [$actions], $method, $name, $filters, $events);
            }
        } else {
            $this->collection[$name ?: count($this->collection)] = (new Route($this->Parser))
                    ->route($path, is_array($actions) ? $actions : [$actions], $method, $name, $filters, $events);
        }

        return $this;
    }
913116
protected function setParams(array $params) {
		parent::setParams($params);
		if($this->autoinc===true){
			$this->notNull=false;
		}
	}
393133
public function setPoints( $points )
    {
        if ( is_array($points) || $points instanceof \Traversable ) {
            array_walk(
                $points,
                function (&$point, $index) {
                    if ( !$point instanceof PointInterface ) {
                        if (is_array($point) && count($point) == 2) {
                            list($x, $y) = array_values($point);
                            $point = new Point($x, $y);
                        } else {
                            $msg = "Point at index #$index does not implement "
                                 . "PointReduction\\Common\\PointInterface";
                            throw new InvalidArgumentException($msg);
                        }
                    }
                }
            );
            $this->points = $points;
        } else {
            $msg = "All points must be a traversable object, or array. "
                 . gettype($points)
                 . " given.";
            throw new InvalidArgumentException($msg);
        }
    }