Library/Phalcon/Migrations/MigrationScript.php
public function batchInsert(\Phalcon\Db\Adapter $connection, $tableName, $fields)
    {
        $migrationData = $this->migrationsDir . '/' . $this->version . '/' . $tableName . '.dat';
        if (file_exists($migrationData)) {
            $connection->begin();
            $batchHandler = fopen($migrationData, 'r');
            while (($line = fgets($batchHandler)) !== false) {
                $connection->insert($tableName, explode('|', rtrim($line)), $fields, false);
                unset($line);
            }
            fclose($batchHandler);
            $connection->commit();
        }
    }
public function batchInsert(\Phalcon\Db\Adapter $connection, $tableName, $fields)
    {
        $migrationData = $this->migrationsDir . '/' . $this->version . '/' . $tableName . '.dat';
        if (file_exists($migrationData)) {
            $connection->begin();
            $batchHandler = fopen($migrationData, 'r');
            while (($line = fgets($batchHandler)) !== false) {
                $connection->insert($tableName, explode('|', rtrim($line)), $fields, false);
                unset($line);
            }
            fclose($batchHandler);
            $connection->commit();
        }
    }
public function batchInsert ( \ Phalcon \ Db \ Adapter $ connection , $ tableName , $ fields ) { $ migrationData = $ this -> migrationsDir . '/' . $ this -> version . '/' . $ tableName . '.dat' ; if ( file_exists ( $ migrationData ) ) { $ connection -> begin ( ) ; $ batchHandler = fopen ( $ migrationData , 'r' ) ; while ( ( $ line = fgets ( $ batchHandler ) ) !== false ) { $ connection -> insert ( $ tableName , explode ( '|' , rtrim ( $ line ) ) , $ fields , false ) ; unset ( $ line ) ; } fclose ( $ batchHandler ) ; $ connection -> commit ( ) ; } }
Inserts data from a data migration file in a table

@param string $tableName
@param string $fields
Inserts data from a data migration file in a table