コード例 #1
0
ファイル: sqlite.php プロジェクト: weareathlon/silla.io
 /**
  * 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}'");
 }
コード例 #2
0
ファイル: mysql.php プロジェクト: weareathlon/silla.io
 /**
  * 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}");
 }
コード例 #3
0
ファイル: model.php プロジェクト: weareathlon/silla.io
 /**
  * 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;
 }