public function load(CM_OutputStream_Interface $output) { $dbClient = $this->getServiceManager()->getDatabases()->getMaster(); $values = Functional\map($this->_getAllTypes(), function ($className, $type) { return [$type, $className]; }); $query = new CM_Db_Query_Truncate($dbClient, 'cm_tmp_classType'); $query->execute(); $query = new CM_Db_Query_Insert($dbClient, 'cm_tmp_classType', ['type', 'className'], $values, null, 'REPLACE'); $query->execute(); }
public function testAll() { $query = new CM_Db_Query_Truncate(self::$_client, 't`est'); $this->assertSame('TRUNCATE TABLE `t``est`', $query->getSqlTemplate()); }
/** * @param string $table */ public static function truncate($table) { $client = self::getClient(); $query = new CM_Db_Query_Truncate($client, $table); $query->execute(); }