コード例 #1
0
ファイル: XmlToDataSQL.php プロジェクト: RafalFilipek/Propel2
 /**
  * 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')));
     }
 }
コード例 #2
0
 /**
  * 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;
 }