Example #1
0
 /**
  * Truncates tables that data is being imported to
  *
  * @author Stian Didriksen <*****@*****.**>
  * @param  KDatabaseTableAbstract $table	The table being deleted
  * @return $this
  */
 protected function _truncateTable(KDatabaseTableAbstract $table)
 {
     $name = $table->getBase();
     //If this table have been truncated ebfore, don't truncate it again
     if (isset($this->trunctated[$name])) {
         return $this;
     }
     $sql = 'TRUNCATE TABLE ' . $table->getDatabase()->quoteName('#__' . $name);
     //Execute the query
     $table->getDatabase()->execute($sql);
     //Update the trunctated array
     $this->trunctated[$name] = true;
     return $this;
 }