From 167a9938205065a2ff36886924fa4e52694d8e99 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Tue, 31 Jan 2017 23:20:35 -0500 Subject: [PATCH] Fix a few deprecated method call sites. I found a few more quickly grepping through the code. --- src/Controller/Controller.php | 2 +- src/Database/Query.php | 2 +- src/Database/SqlDialectTrait.php | 2 +- src/ORM/Behavior/TranslateBehavior.php | 2 +- src/ORM/EagerLoader.php | 4 ++-- src/ORM/Query.php | 4 ++-- src/ORM/Table.php | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Controller/Controller.php b/src/Controller/Controller.php index c510b26088a..d2c04c01549 100644 --- a/src/Controller/Controller.php +++ b/src/Controller/Controller.php @@ -212,7 +212,7 @@ class Controller implements EventListenerInterface, EventDispatcherInterface * Holds all passed params. * * @var array - * @deprecated 3.1.0 Use `$this->request->params['pass']` instead. + * @deprecated 3.1.0 Use `$this->request->getParam('pass')` instead. */ public $passedArgs = []; diff --git a/src/Database/Query.php b/src/Database/Query.php index 9148d6e4143..ebf1224a412 100644 --- a/src/Database/Query.php +++ b/src/Database/Query.php @@ -1371,7 +1371,7 @@ public function insert(array $columns, array $types = []) if (!$this->_parts['values']) { $this->_parts['values'] = new ValuesExpression($columns, $this->getTypeMap()->setTypes($types)); } else { - $this->_parts['values']->columns($columns); + $this->_parts['values']->setColumns($columns); } return $this; diff --git a/src/Database/SqlDialectTrait.php b/src/Database/SqlDialectTrait.php index 05cab5f46c4..6c71e861555 100644 --- a/src/Database/SqlDialectTrait.php +++ b/src/Database/SqlDialectTrait.php @@ -87,7 +87,7 @@ public function quoteIdentifier($identifier) public function queryTranslator($type) { return function ($query) use ($type) { - if ($this->autoQuoting()) { + if ($this->isAutoQuotingEnabled()) { $query = (new IdentifierQuoter($this))->quote($query); } diff --git a/src/ORM/Behavior/TranslateBehavior.php b/src/ORM/Behavior/TranslateBehavior.php index 9b0266af5d2..44d87aed2b2 100644 --- a/src/ORM/Behavior/TranslateBehavior.php +++ b/src/ORM/Behavior/TranslateBehavior.php @@ -216,7 +216,7 @@ public function beforeFind(Event $event, Query $query, $options) return function ($q) use ($field, $locale, $query, $select) { $q->where([$q->repository()->aliasField('locale') => $locale]); - if ($query->autoFields() || + if ($query->isAutoFieldsEnabled() || in_array($field, $select, true) || in_array($this->_table->aliasField($field), $select, true) ) { diff --git a/src/ORM/EagerLoader.php b/src/ORM/EagerLoader.php index 25a76b143aa..11ca37c0365 100644 --- a/src/ORM/EagerLoader.php +++ b/src/ORM/EagerLoader.php @@ -581,7 +581,7 @@ protected function _correctStrategy($loadable) $config['strategy'] = Association::STRATEGY_SELECT; $loadable->setConfig($config); - $loadable->canBeJoined(false); + $loadable->setCanBeJoined(false); } /** @@ -611,7 +611,7 @@ protected function _resolveJoins($associations, $matching = []) $this->_correctStrategy($loadable); } - $loadable->canBeJoined(false); + $loadable->setCanBeJoined(false); $this->_loadExternal[] = $loadable; } diff --git a/src/ORM/Query.php b/src/ORM/Query.php index 60b33f496ef..7d6c60911c2 100644 --- a/src/ORM/Query.php +++ b/src/ORM/Query.php @@ -495,7 +495,7 @@ public function matching($assoc, callable $builder = null) * ->select(['total_articles' => $query->func()->count('Articles.id')]) * ->leftJoinWith('Articles') * ->group(['Users.id']) - * ->autoFields(true); + * ->setAutoFields(true); * ``` * * You can also customize the conditions passed to the LEFT JOIN: @@ -508,7 +508,7 @@ public function matching($assoc, callable $builder = null) * return $q->where(['Articles.votes >=' => 5]); * }) * ->group(['Users.id']) - * ->autoFields(true); + * ->setAutoFields(true); * ``` * * This will create the following SQL: diff --git a/src/ORM/Table.php b/src/ORM/Table.php index 8a529c171b4..eb248611892 100644 --- a/src/ORM/Table.php +++ b/src/ORM/Table.php @@ -316,7 +316,7 @@ public static function defaultConnectionName() * { * $this->belongsTo('Users'); * $this->belongsToMany('Tagging.Tags'); - * $this->primaryKey('something_else'); + * $this->setPrimaryKey('something_else'); * } * ``` *