Example #1
0
 /**
  * Handles closing elements of the xml file.
  *
  * @param      $name The local name (without prefix), or the empty string if
  *         Namespace processing is not being performed.
  */
 public function endElement($name)
 {
     if (self::DEBUG) {
         print "endElement(" . $name . ") called\n";
     }
     if ($name == "dataset") {
         if ($this->currBuilder !== null) {
             $this->sqlWriter->write($this->currBuilder->getTableEndSql());
         }
         $this->sqlWriter->write(call_user_func(array($this->builderClazz, 'getDatabaseEndSql')));
     }
 }
 /**
  * The main method in this class, returns the SQL for INSERTing data into a row.
  * @param      DataRow $row The row to process.
  * @return     string
  */
 public function buildRowSql(DataRow $row)
 {
     $sql = parent::buildRowSql($row);
     $table = $this->getTable();
     if ($table->hasAutoIncrementPrimaryKey() && $table->getIdMethod() == IDMethod::NATIVE) {
         foreach ($row->getColumnValues() as $colValue) {
             if ($colValue->getColumn()->isAutoIncrement()) {
                 if ($colValue->getValue() > $this->maxSeqVal) {
                     $this->maxSeqVal = $colValue->getValue();
                 }
             }
         }
     }
     return $sql;
 }