/** * Clears a table. * * @param string $table Table name. * * @return boolean */ public function clearTable($table) { foreach (Core\DbCache()->cache as $tbl => $value) { if (in_array($table, explode(',', $tbl), true)) { Core\DbCache()->clearCache($tbl); } } return $this->exec("DELETE FROM {$table}") && $this->exec("DELETE FROM sqlite_sequence WHERE name='{$table}'"); }
/** * Purges cache. * * @param string $table Table name. * * @return resource */ public function clearTable($table) { foreach (Core\DbCache()->cache as $tbl => $value) { if (in_array($table, explode(',', $tbl), true)) { Core\DbCache()->clearCache($tbl); } } return $this->execute("TRUNCATE TABLE {$table}"); }
/** * Fetches the i18n_table schema. * * @access public * @static * @uses Core\DbCache() * * @return array */ public static function getI18nSchema() { $schema = Core\DbCache()->getSchema(static::$i18nTableName); if (!empty($schema) && isset($schema[static::$i18nForeignKeyField], $schema[static::$i18nLocaleField])) { unset($schema[static::$i18nForeignKeyField], $schema[static::$i18nLocaleField]); } return $schema; }