/** * Clears the complete table. */ public function truncate() { $table = $this->getDummyModel()->getTableName(); tx_rnbase::load('tx_mklib_util_DB'); return tx_mklib_util_DB::doQuery('TRUNCATE TABLE ' . $table); }
/** * Is logging enabled? * * @param string $tablename * @return boolean */ private static function isLog($tablename) { if (self::$log == -1) { // erst die Extension Konfiguration fragen! tx_rnbase::load('tx_rnbase_configurations'); self::$log = intval(tx_rnbase_configurations::getExtensionCfgValue('mklib', 'logDbHandler')); if (self::$log) { tx_rnbase::load('tx_rnbase_util_Logger'); self::$log = tx_rnbase_util_Logger::isNoticeEnabled(); } } if (self::$log) { // ignore tables besorgen if (!is_array(self::$ignoreTables)) { self::$ignoreTables = t3lib_div::trimExplode(',', tx_rnbase_configurations::getExtensionCfgValue('mklib', 'logDbIgnoreTables'), true); } // tabelle loggen ? if (in_array($tablename, self::$ignoreTables)) { return false; } } return self::$log; }
/** * @expectedException Exception * @expectedExceptionMessage tx_mklib_util_DB::delete(): Cannot soft-delete records in table unknown - no $TCA entry found! * * @group unit */ public function testDeleteWithModeSoftDeleteThrowsExceptionIfNoDeleteColumnInTca() { tx_mklib_util_DB::delete('unknown', '', tx_mklib_util_DB::DELETION_MODE_SOFTDELETE); }