library/Services/Library/DatabaseRestorer/DatabaseRestorer.php
private function getInsertString($rows, $table)
    {
        $columns = array();
        $values = array();
        foreach ($rows as $row) {
            if (empty($columns)) {
                $columns = array_keys($row);
            }
            $rowValues = array();
            foreach ($row as $entry) {
                $entry = is_null($entry) ? "NULL" : \OxidEsales\Eshop\Core\DatabaseProvider::getMaster(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC)->quote($entry);
                $rowValues[] = $entry;
            }
            $values[] = "(". implode(", ", $rowValues).")";
        }

        $query = "INSERT INTO $table ";
        $query .= "(`".implode("`, `", $columns)."`) VALUES ".implode(", ", $values);

        return $query;
    }
private function getInsertString($rows, $table)
    {
        $columns = array();
        $values = array();
        foreach ($rows as $row) {
            if (empty($columns)) {
                $columns = array_keys($row);
            }
            $rowValues = array();
            foreach ($row as $entry) {
                $entry = is_null($entry) ? "NULL" : \OxidEsales\Eshop\Core\DatabaseProvider::getMaster(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC)->quote($entry);
                $rowValues[] = $entry;
            }
            $values[] = "(". implode(", ", $rowValues).")";
        }

        $query = "INSERT INTO $table ";
        $query .= "(`".implode("`, `", $columns)."`) VALUES ".implode(", ", $values);

        return $query;
    }
private function getInsertString ( $ rows , $ table ) { $ columns = array ( ) ; $ values = array ( ) ; foreach ( $ rows as $ row ) { if ( empty ( $ columns ) ) { $ columns = array_keys ( $ row ) ; } $ rowValues = array ( ) ; foreach ( $ row as $ entry ) { $ entry = is_null ( $ entry ) ? "NULL" : \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getMaster ( \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: FETCH_MODE_ASSOC ) -> quote ( $ entry ) ; $ rowValues [ ] = $ entry ; } $ values [ ] = "(" . implode ( ", " , $ rowValues ) . ")" ; } $ query = "INSERT INTO $table " ; $ query .= "(`" . implode ( "`, `" , $ columns ) . "`) VALUES " . implode ( ", " , $ values ) ; return $ query ; }
Creates a insert string to insert the given row into to given table

@param array  $rows  a array of the current row in the db
@param string $table the name of the current table

@return string a sql insert string for the given row
Creates a insert string to insert the given row into to given table