mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
Merge branch 'master' into db-traits
Updated AR classes with the latest changes from master to go on with separation of AR query classes in traits. Conflicts: framework/yii/db/ActiveQuery.php framework/yii/db/ActiveRecord.php framework/yii/db/ActiveRelation.php
This commit is contained in:
@ -30,6 +30,12 @@ class ActiveRelation extends ActiveQuery
|
||||
{
|
||||
use \yii\ar\ActiveRelationTrait;
|
||||
|
||||
/**
|
||||
* @var array|ActiveRelation the query associated with the pivot table. Please call [[via()]]
|
||||
* or [[viaTable()]] to set this property instead of directly setting it.
|
||||
*/
|
||||
public $via;
|
||||
|
||||
/**
|
||||
* Specifies the pivot table.
|
||||
* @param string $tableName the name of the pivot table.
|
||||
@ -72,7 +78,7 @@ class ActiveRelation extends ActiveQuery
|
||||
$this->filterByModels($viaModels);
|
||||
} elseif (is_array($this->via)) {
|
||||
// via relation
|
||||
/** @var $viaQuery ActiveRelation */
|
||||
/** @var ActiveRelation $viaQuery */
|
||||
list($viaName, $viaQuery) = $this->via;
|
||||
if ($viaQuery->multiple) {
|
||||
$viaModels = $viaQuery->all();
|
||||
|
Reference in New Issue
Block a user