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