1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace Doctrine\DBAL\Schema\Synchronizer;
- use Doctrine\DBAL\Connection;
- use Doctrine\Deprecations\Deprecation;
- use Throwable;
- /**
- * Abstract schema synchronizer with methods for executing batches of SQL.
- *
- * @deprecated
- */
- abstract class AbstractSchemaSynchronizer implements SchemaSynchronizer
- {
- /** @var Connection */
- protected $conn;
- public function __construct(Connection $conn)
- {
- $this->conn = $conn;
- Deprecation::trigger(
- 'doctrine/dbal',
- 'https://github.com/doctrine/dbal/pull/4213',
- 'SchemaSynchronizer API is deprecated without a replacement and will be removed in DBAL 3.0'
- );
- }
- /**
- * @param string[] $sql
- *
- * @return void
- */
- protected function processSqlSafely(array $sql)
- {
- foreach ($sql as $s) {
- try {
- $this->conn->exec($s);
- } catch (Throwable $e) {
- }
- }
- }
- /**
- * @param string[] $sql
- *
- * @return void
- */
- protected function processSql(array $sql)
- {
- foreach ($sql as $s) {
- $this->conn->exec($s);
- }
- }
- }
|