Get a route based on command context

@param Context $context Command context

@return Route|false

@access public
432403
public function match(Context $context)
    {
        $name = $this->getName($context);

        if ($this->map->hasRoute($name)) {
            return $this->map->getRoute($name);
        }

        return false;
    }
946956
protected function getPropertyValue(Context $context)
    {
        $propertyValue = null;

        foreach ($this->propertyPaths as $path) {
            if (null !== $propertyValue = SimpleAccessor::getValueFromPath($context, $path)) {
                break;
            }
        }

        return $propertyValue;
    }
991966
public static function getRoutes($context = null)
    {
        if($context == null)
            $context = getenv('ERDIKO_CONTEXT');
        $file = ERDIKO_APP."/config/{$context}/routes.json";
        $applicationConfig = static::getConfigFile($file);
        
        return $applicationConfig['routes'];
    }
1077284
protected function _actionBrowse($context)
    {
        if (!$context->query) {
            $context->query = $this->getRepository()->getQuery();
        }

        $query = $context->query;
        $query->order('open', 'DESC');

        if ($this->sort == 'priority') {
            $query->order('priority', 'DESC');
        }

        return parent::_actionBrowse($context);
    }
977144
public function context(Context $context = null) : Context
    {
        if (!$this->context) {
            $this->context = $context ?: new SimpleContext;
        }

        return $this->context;
    }
43518
protected function _actionBrowse(AnCommandContext $context)
    {
        if ($this->locatable) {

            if (in_array($this->getView()->getLayout(), array('selector', 'list_selector'))) {

                $keyword = ($this->q) ? $this->getService('anahita:filter.term')->sanitize($this->q) : '';

                $query = $this->getService('com:locations.domain.query.selector')
                              ->keyword($keyword)
                              ->excludeIds(AnHelperArray::collect($this->locatable->locations, 'id'))
                              ->locatable($this->locatable)
                              ->nearbyLatitude($this->nearby_latitude)
                              ->nearbyLongitude($this->nearby_longitude);

            } else {
                $query = $this->locatable->locations->order('name');
            }

            $query->limit($this->limit, $this->start);

            return $this->getState()->setList($query->toEntityset())->getList();
        }

        return parent::_actionBrowse($context);
    }
880922
public function getActor(AnCommandContext $context)
    {
        $data = $context->data;

        if ($data->actor) {
            $ret = $this->getService('repos:actors.actor')->fetch($data->actor);
        } else {
            $ret = get_viewer();
        }

        $this->actor = $ret;

        return $this->actor;
    }
307431
protected function getContextAlias($context=null)
    {
        $contextAlias = $this->labeller->uri_to_alias((empty($context)) ? $this->defaultContext : $context);
        return (empty($contextAlias)) ? $this->getConfigInstance()->getDefaultContextAlias() : $contextAlias;
    }
821377
public function executeInContext($context, $service, $operation, $argv = array(), $callback = null)
	{
	    $command = new Command(
            $service,
            $operation,
            $argv,
	        $context);

	    return $this->dispatch($command, $callback);
	}
19499
public function redirect(AnCommandContext $context)
    {
        $url['view'] = AnInflector::pluralize($this->getIdentifier()->name);
        $url['option'] = $this->getIdentifier()->package;

        if ($context->action == 'add') {
            $url['id'] = $this->getItem()->id;
        } elseif ($context->action == 'delete') {
            $url['oid'] = $this->getItem()->owner->id;
        }

        $this->getResponse()->setRedirect(route($url));
    }
534991
public function getContext(ControllerContextInterface $context = null)
    {
        $context = new ControllerContext($context);
        $context->setRequest($this->getRequest());
        $context->setResponse($this->getResponse());
        $context->setUser($this->getUser());

        return $context;
    }
371286
public function apply( $context ) {
		if ( ! $context instanceof RContext ) {
			$context = new Context( $context );
		}

		return $this->evaluate( $context );
	}
1317800
protected function getValueFromContext($rule, $context)
    {
        $segments = explode('.', $rule->field);
        foreach ($segments as $segment) {
            if (!isset($context[$segment])) {
                $context = false;
                break;
            }
            $context = $context[$segment];
        }

        return $context;
    }
1087665
public function getProvidersByContext($context)
    {
        $providers = array();
        
        foreach($this->providers[$context] as $providerId) {
            $providers[] = $this->container->get($providerId);
        }
        
        return $providers;
    }
787899
protected function _getHandler(Context $context)
  {
    $conditions = $this->_generateRoutes();
    if(is_iterable($conditions))
    {
      return $this->_traverseConditions($context, $conditions);
    }
    else if($conditions instanceof Handler || is_callable($conditions) || is_string($conditions))
    {
      return $conditions;
    }

    return null;
  }
339057
public function getActions($context = 'bottom')
    {
        $returnValue = array();

		if(isset($this->actions[$context])){
			$returnValue = $this->actions[$context];
		}

        return (array) $returnValue;
    }
953994
protected function _actionGet(DispatcherContext $context)
    {
        $controller = $this->getController();

        if($controller instanceof ControllerViewable) {
            $result = $controller->execute('render', $controller->getContext($context));
        } else {
            throw new DispatcherExceptionMethodNotAllowed('Method GET not allowed');
        }

        return $result;
    }