示例#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();
 }
示例#2
0
文件: Db.php 项目: NicolasSchmutz/cm
 /**
  * @param string $table
  */
 public static function truncate($table)
 {
     $client = self::getClient();
     $query = new CM_Db_Query_Truncate($client, $table);
     $query->execute();
 }