0 && $widthRatio == 0) { $data = static::fetchCachedData($filter); $save_cache = true; } if (isset($data) === false) { $data = static::fetchDataFromDB($filter, $ratio, $widthRatio); } else { // Retrieved from cache. $save_cache = false; } if ($save_cache === true) { // Rebuild cache. if (static::saveCachedData($filter, $data) !== true) { throw new \Exception( $config['dbconnection']->error ); } } return static::fromArray($data); } }