This is in core/model/modx/modx.class.php, if that helps:
/**
* Switches the primary Context for the modX instance.
*
* Be aware that switching contexts does not allow custom session handling
* classes to be loaded. The gateway defines the session handling that is
* applied to a single request. To create a context with a custom session
* handler you must create a unique context gateway that initializes that
* context directly.
*
* @param string $contextKey The key of the context to switch to.
* @param boolean $reload Set to true to force the context data to be regenerated
* before being switched to.
* @return boolean True if the switch was successful, otherwise false.
*/
public function switchContext($contextKey, $reload = false) {
$switched= false;
if ($this->context->key != $contextKey) {
$switched= $this->_initContext($contextKey, $reload);
if ($switched) {
if (is_array($this->config)) {
$this->setPlaceholders($this->config, '+');
}
}
}
return $switched;
}
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone:
http://bobsguides.com/modx.html