43 $scope = trim($scope);
44 $class = __NAMESPACE__ .
'\\Scope\\' . $scope;
45 if (class_exists($class))
60 if (preg_match(
'#^/' . self::PSEUDO_SCOPE_CODE_FORMS .
'[\d]*/$#', $siteCode))
73 public static function setScope($scope, array $params = [])
76 if (!is_string($scope) || !$scope)
86 if (self::$currentScopeClass)
88 self::$scopeInit =
true;
89 self::$currentScopeClass::init($params);
100 self::$scopeInit =
false;
101 self::$currentScopeClass =
null;
112 return !($scope ===
'KNOWLEDGE' || $scope ===
'GROUP');
121 if (self::$currentScopeClass !==
null)
123 return self::$currentScopeClass::getPublicationPath();
135 if (self::$currentScopeClass !==
null)
137 return self::$currentScopeClass::getKeyCode();
149 if (self::$currentScopeClass !==
null)
151 return self::$currentScopeClass::getDomainId();
162 if (self::$currentScopeClass !==
null)
164 return self::$currentScopeClass::getCurrentScopeId();
176 if (self::$currentScopeClass !==
null)
178 return self::$currentScopeClass::getFilterType();
182 return $strict ? null : [
'PAGE',
'STORE',
'SMN'];
191 if (self::$currentScopeClass !==
null)
193 return self::$currentScopeClass::getExcludedHooks();
206 if (is_string($code))
208 $code = mb_strtoupper(trim($code));
210 if (array_key_exists($code, $types))
228 self::$currentScopeClass !==
null
229 && is_callable([self::$currentScopeClass,
'getOperationsForSite'])
232 return self::$currentScopeClass::getOperationsForSite($siteId);
static setExpectedType($type)
static getPublicationPath()
static getOperationsForSite(int $siteId)
static getExcludedHooks()
const SCOPE_CODE_KNOWLEDGE
static setScope($scope, array $params=[])
static getScopeClass($scope)
static getSiteTypeForms($siteCode)
static isPublicScope(?string $scope=null)
static $currentScopeClass
static getFilterType($strict=false)
const PSEUDO_SCOPE_CODE_FORMS
static getCurrentScopeId()