public static function createVariableCache() { self::createCacheFile(); $content = '<?php' . self::$newLine; $dataList = Variable::findAll(); foreach ($dataList as $row) { $id = $row['id']; $content .= '$cachedVariables[\'' . $row['id'] . '\']=[' . self::$newLine; $content .= self::getCacheItem('id', $row); $content .= self::getCacheItem('name', $row); $content .= self::getCacheItem('value', $row); $content .= self::getCacheItem('data_type', $row, 'int'); $content .= self::getCacheItem('is_cache', $row, 'bool'); $content .= self::getCacheItem('note', $row); $content .= "];" . self::$newLine; } self::writeFile('cachedVariables.php', $content); }