Exemplo n.º 1
0
 /**
  * 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}'");
 }
Exemplo n.º 2
0
 /**
  * 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}");
 }
Exemplo n.º 3
0
 /**
  * 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;
 }