Exemple #1
0
 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();
 }
Exemple #2
0
 public function testAll()
 {
     $query = new CM_Db_Query_Truncate(self::$_client, 't`est');
     $this->assertSame('TRUNCATE TABLE `t``est`', $query->getSqlTemplate());
 }
Exemple #3
0
 /**
  * @param string $table
  */
 public static function truncate($table)
 {
     $client = self::getClient();
     $query = new CM_Db_Query_Truncate($client, $table);
     $query->execute();
 }