. */ /* */ /*************************************************************************************/ namespace Thelia\Core; class Context { const CONTEXT_FRONT_OFFICE = 'front'; const CONTEXT_BACK_OFFICE = 'admin'; protected $defineContext = array( self::CONTEXT_BACK_OFFICE, self::CONTEXT_FRONT_OFFICE ); protected $currentContext = self::CONTEXT_FRONT_OFFICE; public function isValidContext($context) { return in_array($context, $this->defineContext); } public function setContext($context) { if ($this->isValidContext($context)) { $this->currentContext = $context; } } public function getContext() { return $this->currentContext; } }