_getData(CategoryAttribute::KEY_IS_GLOBAL); if ($scope === CategoryAttribute::SCOPE_GLOBAL) { return CategoryAttribute::SCOPE_GLOBAL_TEXT; } if ($scope === CategoryAttribute::SCOPE_WEBSITE) { return CategoryAttribute::SCOPE_WEBSITE_TEXT; } return CategoryAttribute::SCOPE_STORE_TEXT; } /** * Set attribute scope * * @param string $scope * @return $this */ public function setScope($scope) { if ($scope === CategoryAttribute::SCOPE_GLOBAL_TEXT) { return $this->setData(CategoryAttribute::KEY_IS_GLOBAL, CategoryAttribute::SCOPE_GLOBAL); } if ($scope === CategoryAttribute::SCOPE_WEBSITE_TEXT) { return $this->setData(CategoryAttribute::KEY_IS_GLOBAL, CategoryAttribute::SCOPE_WEBSITE); } if ($scope === CategoryAttribute::SCOPE_STORE_TEXT) { return $this->setData(CategoryAttribute::KEY_IS_GLOBAL, CategoryAttribute::SCOPE_STORE); } //Ignore unrecognized scope return $this; } /** * Return is attribute global * * @return integer */ public function getIsGlobal(): int { return (int) $this->_getData(CategoryAttribute::KEY_IS_GLOBAL); } /** * Retrieve attribute is global scope flag * * @return bool */ public function isScopeGlobal(): bool { return $this->getIsGlobal() === CategoryAttribute::SCOPE_GLOBAL; } /** * Retrieve attribute is website scope website * * @return bool */ public function isScopeWebsite(): bool { return $this->getIsGlobal() === CategoryAttribute::SCOPE_WEBSITE; } /** * Retrieve attribute is store scope flag * * @return bool */ public function isScopeStore(): bool { return !$this->isScopeGlobal() && !$this->isScopeWebsite(); } }