Doctrine\DBAL\Migrations\Version::executeRegisteredSql PHP Method

executeRegisteredSql() private method

private executeRegisteredSql ( $dryRun = false, $timeAllQueries = false )
    private function executeRegisteredSql($dryRun = false, $timeAllQueries = false)
    {
        if (!$dryRun) {
            if (!empty($this->sql)) {
                foreach ($this->sql as $key => $query) {
                    $queryStart = microtime(true);
                    if (!isset($this->params[$key])) {
                        $this->outputWriter->write('     <comment>-></comment> ' . $query);
                        $this->connection->executeQuery($query);
                    } else {
                        $this->outputWriter->write(sprintf('    <comment>-</comment> %s (with parameters)', $query));
                        $this->connection->executeQuery($query, $this->params[$key], $this->types[$key]);
                    }
                    $this->outputQueryTime($queryStart, $timeAllQueries);
                }
            } else {
                $this->outputWriter->write(sprintf('<error>Migration %s was executed but did not result in any SQL statements.</error>', $this->version));
            }
        } else {
            foreach ($this->sql as $idx => $query) {
                $this->outputSqlQuery($idx, $query);
            }
        }
    }