core/traits/CacheableTrait.php
public function getHasCache($key)
    {
        if ($this->isCachable()) {
            $data = Yii::$app->cache->get($key);
            
            $enumKey = (is_array($key)) ? implode(",", $key) : $key;
            
            if ($data) {
                Yii::debug("Cacheable trait key '$enumKey' successfully loaded from cache.", __METHOD__);
                return $data;
            }
            Yii::debug("Cacheable trait key '$enumKey' has not been found in cache.", __METHOD__);
        }
    
        return false;
    }
public function getHasCache($key)
    {
        if ($this->isCachable()) {
            $data = Yii::$app->cache->get($key);
            
            $enumKey = (is_array($key)) ? implode(",", $key) : $key;
            
            if ($data) {
                Yii::debug("Cacheable trait key '$enumKey' successfully loaded from cache.", __METHOD__);
                return $data;
            }
            Yii::debug("Cacheable trait key '$enumKey' has not been found in cache.", __METHOD__);
        }
    
        return false;
    }
public function getHasCache ( $ key ) { if ( $ this -> isCachable ( ) ) { $ data = Yii :: $ app -> cache -> get ( $ key ) ; $ enumKey = ( is_array ( $ key ) ) ? implode ( "," , $ key ) : $ key ; if ( $ data ) { Yii :: debug ( "Cacheable trait key '$enumKey' successfully loaded from cache." , __METHOD__ ) ; return $ data ; } Yii :: debug ( "Cacheable trait key '$enumKey' has not been found in cache." , __METHOD__ ) ; } return false ; }
Get the caching data if caching is allowed and there is any data stored for this key.

@param string|array $key The identifiere key, can be a string or an array which will be calculated.
@return mixed|boolean Returns the data, if not found returns false.
Get the caching data if caching is allowed and there is any data stored for this key .