Neos\Flow\Persistence\Doctrine\Service::buildCodeFromSql PHP Метод

buildCodeFromSql() защищенный Метод

Returns PHP code for a migration file that "executes" the given array of SQL statements.
protected buildCodeFromSql ( Configuration $configuration, array $sql ) : string
$configuration Doctrine\DBAL\Migrations\Configuration\Configuration
$sql array
Результат string
    protected function buildCodeFromSql(Configuration $configuration, array $sql)
    {
        $currentPlatform = $configuration->getConnection()->getDatabasePlatform()->getName();
        $code = [];
        foreach ($sql as $query) {
            if (stripos($query, $configuration->getMigrationsTableName()) !== false) {
                continue;
            }
            $code[] = sprintf('$this->addSql(%s);', var_export($query, true));
        }
        if (!empty($code)) {
            array_unshift($code, sprintf('$this->abortIf($this->connection->getDatabasePlatform()->getName() != %s, %s);', var_export($currentPlatform, true), var_export(sprintf('Migration can only be executed safely on "%s".', $currentPlatform), true)), '');
        }
        return implode(chr(10), $code);
    }