Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function getTypeLabels()
 {
     $types = [];
     foreach ($this->_config->getTypes() as $type => $node) {
         if (array_key_exists('label', $node)) {
             $types[$type] = $node['label'];
         }
     }
     return $types;
 }
Beispiel #2
0
 /**
  * Get information about all declared cache types
  *
  * @return array
  */
 public function getTypes()
 {
     $types = array();
     $config = $this->_config->getTypes();
     foreach ($config as $type => $node) {
         $typeInstance = $this->_getTypeInstance($type);
         if ($typeInstance instanceof \Magento\Framework\Cache\Frontend\Decorator\TagScope) {
             $typeTags = $typeInstance->getTag();
         } else {
             $typeTags = '';
         }
         $types[$type] = new \Magento\Framework\Object(array('id' => $type, 'cache_type' => $node['label'], 'description' => $node['description'], 'tags' => $typeTags, 'status' => (int) $this->_cacheState->isEnabled($type)));
     }
     return $types;
 }