Commit f6dd6fa2 by Qiang Xue

Renamed `ActiveRecordInterface::createActiveRelation()` to `createRelation()`

parent 0dfc8b1f
......@@ -143,7 +143,7 @@ class ActiveRecord extends BaseActiveRecord
/**
* @inheritdoc
*/
public static function createActiveRelation($config = [])
public static function createRelation($config = [])
{
return new ActiveRelation($config);
}
......
......@@ -154,7 +154,7 @@ abstract class ActiveRecord extends BaseActiveRecord
* @param array $config the configuration passed to the ActiveRelation class.
* @return ActiveRelation the newly created [[ActiveRelation]] instance.
*/
public static function createActiveRelation($config = [])
public static function createRelation($config = [])
{
return new ActiveRelation($config);
}
......@@ -350,4 +350,4 @@ abstract class ActiveRecord extends BaseActiveRecord
}
return $this->collectionName() === $record->collectionName() && (string)$this->getPrimaryKey() === (string)$record->getPrimaryKey();
}
}
\ No newline at end of file
}
......@@ -72,7 +72,7 @@ abstract class ActiveRecord extends \yii\mongodb\ActiveRecord
* @param array $config the configuration passed to the ActiveRelation class.
* @return ActiveRelation the newly created [[ActiveRelation]] instance.
*/
public static function createActiveRelation($config = [])
public static function createRelation($config = [])
{
return new ActiveRelation($config);
}
......@@ -331,4 +331,4 @@ abstract class ActiveRecord extends \yii\mongodb\ActiveRecord
throw new InvalidParamException('Unsupported type of "file" attribute.');
}
}
}
\ No newline at end of file
}
......@@ -59,7 +59,7 @@ class ActiveRecord extends BaseActiveRecord
/**
* @inheritdoc
*/
public static function createActiveRelation($config = [])
public static function createRelation($config = [])
{
return new ActiveRelation($config);
}
......
......@@ -310,7 +310,7 @@ abstract class ActiveRecord extends BaseActiveRecord
* @param array $config the configuration passed to the ActiveRelation class.
* @return ActiveRelationInterface the newly created [[ActiveRelation]] instance.
*/
public static function createActiveRelation($config = [])
public static function createRelation($config = [])
{
return new ActiveRelation($config);
}
......
......@@ -128,6 +128,7 @@ Yii Framework 2 Change Log
- Chg: Advanced app template: moved database connection DSN, login and password to `-local` config not to expose it to VCS (samdark)
- Chg: Renamed `yii\web\Request::acceptedLanguages` to `acceptableLanguages` (qiangxue)
- Chg: Removed implementation of `Arrayable` from `yii\Object` (qiangxue)
- Chg: Renamed `ActiveRecordInterface::createActiveRelation()` to `createRelation()` (qiangxue)
- New #66: [Auth client library](https://github.com/yiisoft/yii2-authclient) OpenId, OAuth1, OAuth2 clients (klimov-paul)
- New #1393: [Codeception testing framework integration](https://github.com/yiisoft/yii2-codeception) (Ragazzo)
- New #1438: [MongoDB integration](https://github.com/yiisoft/yii2-mongodb) ActiveRecord and Query (klimov-paul)
......
......@@ -269,7 +269,7 @@ class ActiveRecord extends BaseActiveRecord
* @param array $config the configuration passed to the ActiveRelation class.
* @return ActiveRelation the newly created [[ActiveRelation]] instance.
*/
public static function createActiveRelation($config = [])
public static function createRelation($config = [])
{
return new ActiveRelation($config);
}
......
......@@ -263,7 +263,7 @@ interface ActiveRecordInterface
* @param array $config the configuration passed to the ActiveRelation class.
* @return ActiveRelation the newly created [[ActiveRelation]] instance.
*/
public static function createActiveRelation($config = []);
public static function createRelation($config = []);
/**
* Returns the relation object with the specified name.
......
......@@ -325,7 +325,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
public function hasOne($class, $link)
{
/** @var ActiveRecord $class */
return $class::createActiveRelation([
return $class::createRelation([
'modelClass' => $class,
'primaryModel' => $this,
'link' => $link,
......@@ -364,7 +364,7 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
public function hasMany($class, $link)
{
/** @var ActiveRecord $class */
return $class::createActiveRelation([
return $class::createRelation([
'modelClass' => $class,
'primaryModel' => $this,
'link' => $link,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment