Browse Source

Fix a few deprecated method call sites.

I found a few more quickly grepping through the code.
Mark Story 9 years ago
parent
commit
167a993820

+ 1 - 1
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 = [];
 

+ 1 - 1
src/Database/Query.php

@@ -1371,7 +1371,7 @@ class Query implements ExpressionInterface, IteratorAggregate
         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;

+ 1 - 1
src/Database/SqlDialectTrait.php

@@ -87,7 +87,7 @@ trait SqlDialectTrait
     public function queryTranslator($type)
     {
         return function ($query) use ($type) {
-            if ($this->autoQuoting()) {
+            if ($this->isAutoQuotingEnabled()) {
                 $query = (new IdentifierQuoter($this))->quote($query);
             }
 

+ 1 - 1
src/ORM/Behavior/TranslateBehavior.php

@@ -216,7 +216,7 @@ class TranslateBehavior extends Behavior implements PropertyMarshalInterface
             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)
                 ) {

+ 2 - 2
src/ORM/EagerLoader.php

@@ -581,7 +581,7 @@ class EagerLoader
 
         $config['strategy'] = Association::STRATEGY_SELECT;
         $loadable->setConfig($config);
-        $loadable->canBeJoined(false);
+        $loadable->setCanBeJoined(false);
     }
 
     /**
@@ -611,7 +611,7 @@ class EagerLoader
                 $this->_correctStrategy($loadable);
             }
 
-            $loadable->canBeJoined(false);
+            $loadable->setCanBeJoined(false);
             $this->_loadExternal[] = $loadable;
         }
 

+ 2 - 2
src/ORM/Query.php

@@ -495,7 +495,7 @@ class Query extends DatabaseQuery implements JsonSerializable, QueryInterface
      *     ->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 @@ class Query extends DatabaseQuery implements JsonSerializable, QueryInterface
      *         return $q->where(['Articles.votes >=' => 5]);
      *     })
      *     ->group(['Users.id'])
-     *     ->autoFields(true);
+     *     ->setAutoFields(true);
      * ```
      *
      * This will create the following SQL:

+ 1 - 1
src/ORM/Table.php

@@ -316,7 +316,7 @@ class Table implements RepositoryInterface, EventListenerInterface, EventDispatc
      *  {
      *      $this->belongsTo('Users');
      *      $this->belongsToMany('Tagging.Tags');
-     *      $this->primaryKey('something_else');
+     *      $this->setPrimaryKey('something_else');
      *  }
      * ```
      *