Skip to content
Permalink
Browse files

Remove deprecated driver() calls

  • Loading branch information...
cleptric committed Jul 27, 2017
1 parent 1e0e0c5 commit 94f7011941e81226943c368545372818c1bc96ce
@@ -211,7 +211,7 @@ public function connection($connection = null)
public function execute()
{
$statement = $this->_connection->run($this);
$driver = $this->_connection->driver();
$driver = $this->_connection->getDriver();
$typeMap = $this->getSelectTypeMap();
if ($typeMap->toArray() && $this->_typeCastAttached === false) {
@@ -1982,7 +1982,7 @@ public function selectTypeMap(TypeMap $typeMap = null)
protected function _decorateStatement($statement)
{
foreach ($this->_resultDecorators as $f) {
$statement = new CallbackStatement($statement, $this->getConnection()->driver(), $f);
$statement = new CallbackStatement($statement, $this->getConnection()->getDriver(), $f);
}
return $statement;
@@ -156,7 +156,7 @@ protected function _sqlCompiler(&$sql, $query, $generator)
*/
protected function _buildSelectPart($parts, $query, $generator)
{
$driver = $query->getConnection()->driver();
$driver = $query->getConnection()->getDriver();
$select = 'SELECT%s %s%s';
if ($this->_orderedUnion && $query->clause('union')) {
$select = '(SELECT%s %s%s';
@@ -49,7 +49,7 @@ class Collection
public function __construct(Connection $connection)
{
$this->_connection = $connection;
$this->_dialect = $connection->driver()->schemaDialect();
$this->_dialect = $connection->getDriver()->schemaDialect();
}
/**
@@ -780,7 +780,7 @@ public function temporary($temporary = null)
*/
public function createSql(Connection $connection)
{
$dialect = $connection->driver()->schemaDialect();
$dialect = $connection->getDriver()->schemaDialect();
$columns = $constraints = $indexes = [];
foreach (array_keys($this->_columns) as $name) {
$columns[] = $dialect->columnSql($this, $name);
@@ -800,7 +800,7 @@ public function createSql(Connection $connection)
*/
public function dropSql(Connection $connection)
{
$dialect = $connection->driver()->schemaDialect();
$dialect = $connection->getDriver()->schemaDialect();
return $dialect->dropTableSql($this);
}
@@ -810,7 +810,7 @@ public function dropSql(Connection $connection)
*/
public function truncateSql(Connection $connection)
{
$dialect = $connection->driver()->schemaDialect();
$dialect = $connection->getDriver()->schemaDialect();
return $dialect->truncateTableSql($this);
}
@@ -820,7 +820,7 @@ public function truncateSql(Connection $connection)
*/
public function addConstraintSql(Connection $connection)
{
$dialect = $connection->driver()->schemaDialect();
$dialect = $connection->getDriver()->schemaDialect();
return $dialect->addConstraintSql($this);
}
@@ -830,7 +830,7 @@ public function addConstraintSql(Connection $connection)
*/
public function dropConstraintSql(Connection $connection)
{
$dialect = $connection->driver()->schemaDialect();
$dialect = $connection->getDriver()->schemaDialect();
return $dialect->dropConstraintSql($this);
}
@@ -254,7 +254,7 @@ protected function _assertFieldsPresent($fetchQuery, $key)
$missingFields = $missingKey($select, $key);
if ($missingFields) {
$driver = $fetchQuery->getConnection()->driver();
$driver = $fetchQuery->getConnection()->getDriver();
$quoted = array_map([$driver, 'quoteIdentifier'], $key);
$missingFields = $missingKey($select, $quoted);
}
@@ -647,7 +647,7 @@ public function loadExternal($query, $statement)
return $statement;
}
$driver = $query->getConnection()->driver();
$driver = $query->getConnection()->getDriver();
list($collected, $statement) = $this->_collectKeys($external, $query, $statement);
foreach ($external as $meta) {
@@ -803,7 +803,7 @@ protected function _collectKeys($external, $query, $statement)
}
if (!($statement instanceof BufferedStatement)) {
$statement = new BufferedStatement($statement, $query->getConnection()->driver());
$statement = new BufferedStatement($statement, $query->getConnection()->getDriver());
}
return [$this->_groupKeys($statement, $collectKeys), $statement];
@@ -1926,7 +1926,7 @@ protected function _insert($entity, $data)
$success = $entity;
$entity->set($filteredKeys, ['guard' => false]);
$schema = $this->getSchema();
$driver = $this->getConnection()->driver();
$driver = $this->getConnection()->getDriver();
foreach ($primary as $key => $v) {
if (!isset($data[$key])) {
$id = $statement->lastInsertId($this->getTable(), $key);
@@ -884,7 +884,7 @@ public function testAddConstraintSql()
$connection = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$connection->expects($this->any())->method('driver')
$connection->expects($this->any())->method('getDriver')
->will($this->returnValue($driver));
$table = (new TableSchema('posts'))
@@ -935,7 +935,7 @@ public function testDropConstraintSql()
$connection = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$connection->expects($this->any())->method('driver')
$connection->expects($this->any())->method('getDriver')
->will($this->returnValue($driver));
$table = (new TableSchema('posts'))
@@ -1021,7 +1021,7 @@ public function testCreateSql()
$connection = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$connection->expects($this->any())->method('driver')
$connection->expects($this->any())->method('getDriver')
->will($this->returnValue($driver));
$driver->connection()
@@ -1091,7 +1091,7 @@ public function testCreateSqlJson()
->disableOriginalConstructor()
->getMock();
$connection->expects($this->any())
->method('driver')
->method('getDriver')
->will($this->returnValue($driver));
$driver->connection()
@@ -1139,7 +1139,7 @@ public function testCreateTemporary()
$connection = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$connection->expects($this->any())->method('driver')
$connection->expects($this->any())->method('getDriver')
->will($this->returnValue($driver));
$table = (new TableSchema('schema_articles'))->addColumn('id', [
'type' => 'integer',
@@ -1161,7 +1161,7 @@ public function testCreateSqlCompositeIntegerKey()
$connection = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$connection->expects($this->any())->method('driver')
$connection->expects($this->any())->method('getDriver')
->will($this->returnValue($driver));
$table = (new TableSchema('articles_tags'))
@@ -1227,7 +1227,7 @@ public function testDropSql()
$connection = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$connection->expects($this->any())->method('driver')
$connection->expects($this->any())->method('getDriver')
->will($this->returnValue($driver));
$table = new TableSchema('articles');
@@ -1247,7 +1247,7 @@ public function testTruncateSql()
$connection = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$connection->expects($this->any())->method('driver')
$connection->expects($this->any())->method('getDriver')
->will($this->returnValue($driver));
$table = new TableSchema('articles');
@@ -952,7 +952,7 @@ public function testAddConstraintSql()
$connection = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$connection->expects($this->any())->method('driver')
$connection->expects($this->any())->method('getDriver')
->will($this->returnValue($driver));
$table = (new TableSchema('posts'))
@@ -1003,7 +1003,7 @@ public function testDropConstraintSql()
$connection = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$connection->expects($this->any())->method('driver')
$connection->expects($this->any())->method('getDriver')
->will($this->returnValue($driver));
$table = (new TableSchema('posts'))
@@ -1054,7 +1054,7 @@ public function testCreateSql()
$connection = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$connection->expects($this->any())->method('driver')
$connection->expects($this->any())->method('getDriver')
->will($this->returnValue($driver));
$table = (new TableSchema('schema_articles'))->addColumn('id', [
@@ -1121,7 +1121,7 @@ public function testCreateTemporary()
$connection = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$connection->expects($this->any())->method('driver')
$connection->expects($this->any())->method('getDriver')
->will($this->returnValue($driver));
$table = (new TableSchema('schema_articles'))->addColumn('id', [
'type' => 'integer',
@@ -1143,7 +1143,7 @@ public function testCreateSqlCompositeIntegerKey()
$connection = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$connection->expects($this->any())->method('driver')
$connection->expects($this->any())->method('getDriver')
->will($this->returnValue($driver));
$table = (new TableSchema('articles_tags'))
@@ -1209,7 +1209,7 @@ public function testDropSql()
$connection = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$connection->expects($this->any())->method('driver')
$connection->expects($this->any())->method('getDriver')
->will($this->returnValue($driver));
$table = new TableSchema('schema_articles');
@@ -1229,7 +1229,7 @@ public function testTruncateSql()
$connection = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$connection->expects($this->any())->method('driver')
$connection->expects($this->any())->method('getDriver')
->will($this->returnValue($driver));
$table = new TableSchema('schema_articles');
@@ -634,7 +634,7 @@ public function testAddConstraintSql()
$connection = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$connection->expects($this->any())->method('driver')
$connection->expects($this->any())->method('getDriver')
->will($this->returnValue($driver));
$table = new TableSchema('posts');
@@ -654,7 +654,7 @@ public function testDropConstraintSql()
$connection = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$connection->expects($this->any())->method('driver')
$connection->expects($this->any())->method('getDriver')
->will($this->returnValue($driver));
$table = new TableSchema('posts');
@@ -849,7 +849,7 @@ public function testCreateSql()
$connection = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$connection->expects($this->any())->method('driver')
$connection->expects($this->any())->method('getDriver')
->will($this->returnValue($driver));
$table = (new TableSchema('articles'))->addColumn('id', [
@@ -901,7 +901,7 @@ public function testCreateTemporary()
$connection = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$connection->expects($this->any())->method('driver')
$connection->expects($this->any())->method('getDriver')
->will($this->returnValue($driver));
$table = (new TableSchema('schema_articles'))->addColumn('id', [
'type' => 'integer',
@@ -923,7 +923,7 @@ public function testCreateSqlCompositeIntegerKey()
$connection = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$connection->expects($this->any())->method('driver')
$connection->expects($this->any())->method('getDriver')
->will($this->returnValue($driver));
$table = (new TableSchema('articles_tags'))
@@ -991,7 +991,7 @@ public function testDropSql()
$connection = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$connection->expects($this->any())->method('driver')
$connection->expects($this->any())->method('getDriver')
->will($this->returnValue($driver));
$table = new TableSchema('articles');
@@ -1011,7 +1011,7 @@ public function testTruncateSql()
$connection = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$connection->expects($this->any())->method('driver')
$connection->expects($this->any())->method('getDriver')
->will($this->returnValue($driver));
$statement = $this->getMockBuilder('\PDOStatement')
@@ -1043,7 +1043,7 @@ public function testTruncateSqlNoSequences()
$connection = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$connection->expects($this->any())->method('driver')
$connection->expects($this->any())->method('getDriver')
->will($this->returnValue($driver));
$statement = $this->getMockBuilder('\PDOStatement')
@@ -795,7 +795,7 @@ public function testAddConstraintSql()
$connection = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$connection->expects($this->any())->method('driver')
$connection->expects($this->any())->method('getDriver')
->will($this->returnValue($driver));
$table = (new TableSchema('posts'))
@@ -846,7 +846,7 @@ public function testDropConstraintSql()
$connection = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$connection->expects($this->any())->method('driver')
$connection->expects($this->any())->method('getDriver')
->will($this->returnValue($driver));
$table = (new TableSchema('posts'))
@@ -897,7 +897,7 @@ public function testCreateSql()
$connection = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$connection->expects($this->any())->method('driver')
$connection->expects($this->any())->method('getDriver')
->will($this->returnValue($driver));
$table = (new TableSchema('schema_articles'))->addColumn('id', [
@@ -959,7 +959,7 @@ public function testDropSql()
$connection = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$connection->expects($this->any())->method('driver')
$connection->expects($this->any())->method('getDriver')
->will($this->returnValue($driver));
$table = new TableSchema('schema_articles');
@@ -979,7 +979,7 @@ public function testTruncateSql()
$connection = $this->getMockBuilder('Cake\Database\Connection')
->disableOriginalConstructor()
->getMock();
$connection->expects($this->any())->method('driver')
$connection->expects($this->any())->method('getDriver')
->will($this->returnValue($driver));
$table = new TableSchema('schema_articles');

0 comments on commit 94f7011

Please sign in to comment.
You can’t perform that action at this time.