Pimcore\ExtensionManager::isEnabled PHP Метод

isEnabled() публичный статический Метод

public static isEnabled ( $type, $id ) : boolean
$type
$id
Результат boolean
    public static function isEnabled($type, $id)
    {
        $config = self::getConfig();
        if ($type == "brick") {
            // bricks are enabled per default
            if (!isset($config->brick->{$id})) {
                return true;
            } else {
                return (bool) $config->{$type}->{$id};
            }
        } else {
            // plugins (any maybe others) need to be explicitly enabled
            if ($config->{$type}) {
                return (bool) $config->{$type}->{$id};
            }
        }
        return false;
    }

Usage Example

Пример #1
0
 /**
  * @param bool $arrayKeys
  *
  * @return array|mixed
  */
 private static function getActiveBricks($arrayKeys = TRUE)
 {
     $areaElements = ExtensionManager::getBrickConfigs();
     /**
      * @var String $areaElementName
      * @var \Zend_Config_Xml $areaElementData
      */
     foreach ($areaElements as $areaElementName => $areaElementData) {
         if (!ExtensionManager::isEnabled('brick', $areaElementName)) {
             unset($areaElements[$areaElementName]);
             continue;
         }
     }
     if ($arrayKeys === TRUE) {
         return array_keys($areaElements);
     }
     return $areaElements;
 }
All Usage Examples Of Pimcore\ExtensionManager::isEnabled