diff --git a/framework/yii/ar/ActiveQueryInterface.php b/framework/yii/ar/ActiveQueryInterface.php index e2bb780..ddcb027 100644 --- a/framework/yii/ar/ActiveQueryInterface.php +++ b/framework/yii/ar/ActiveQueryInterface.php @@ -9,7 +9,7 @@ namespace yii\ar; use yii\db\QueryInterface; /** - * ActiveQueryInterface defines the common interface to be implemented by active record relation classes. + * ActiveQueryInterface defines the common interface to be implemented by active record query classes. * * A class implementing this interface should also use [[ActiveQueryTrait]]. * diff --git a/framework/yii/ar/ActiveQueryTrait.php b/framework/yii/ar/ActiveQueryTrait.php index 8c8d6c0..e45f72a 100644 --- a/framework/yii/ar/ActiveQueryTrait.php +++ b/framework/yii/ar/ActiveQueryTrait.php @@ -10,30 +10,7 @@ namespace yii\ar; use yii\db\ActiveRecord; /** - * ActiveQueryTrait implements the common set of methods that are used by DB queries associated with an Active Record class. - * - * ActiveQuery mainly provides the following methods to retrieve the query results: - * - * - [[one()]]: returns a single record populated with the first row of data. - * - [[all()]]: returns all records based on the query results. - * - [[count()]]: returns the number of records. - * - [[scalar()]]: returns the value of the first column in the first row of the query result. - * - [[exists()]]: returns a value indicating whether the query result has data or not. - * - * Because ActiveQuery extends from [[Query]], one can use query methods, such as [[where()]], - * [[orderBy()]] to customize the query options. - * - * ActiveQuery also provides the following additional query options: - * - * - [[with()]]: list of relations that this query should be performed with. - * - [[indexBy()]]: the name of the column by which the query result should be indexed. - * - [[asArray()]]: whether to return each record as an array. - * - * These options can be configured using methods of the same name. For example: - * - * ~~~ - * $customers = Customer::find()->with('orders')->asArray()->all(); - * ~~~ + * ActiveQueryTrait implements the common methods and properties for active record query classes. * * @author Qiang Xue * @author Carsten Brandt diff --git a/framework/yii/ar/ActiveRelationInterface.php b/framework/yii/ar/ActiveRelationInterface.php index 70b723a..1d58a7d 100644 --- a/framework/yii/ar/ActiveRelationInterface.php +++ b/framework/yii/ar/ActiveRelationInterface.php @@ -10,6 +10,8 @@ namespace yii\ar; /** * ActiveRelationInterface defines the common interface to be implemented by active record relation classes. * + * A class implementing this interface should also use [[ActiveRelationTrait]]. + * * @author Qiang Xue * @author Carsten Brandt * @since 2.0 diff --git a/framework/yii/ar/ActiveRelationTrait.php b/framework/yii/ar/ActiveRelationTrait.php index 5d49641..6b617bc 100644 --- a/framework/yii/ar/ActiveRelationTrait.php +++ b/framework/yii/ar/ActiveRelationTrait.php @@ -11,16 +11,7 @@ use yii\base\InvalidConfigException; use yii\db\ActiveRecord; /** - * ActiveRelation represents a relation between two Active Record classes. - * - * ActiveRelation instances are usually created by calling [[ActiveRecord::hasOne()]] and - * [[ActiveRecord::hasMany()]]. An Active Record class declares a relation by defining - * a getter method which calls one of the above methods and returns the created ActiveRelation object. - * - * A relation is specified by [[link]] which represents the association between columns - * of different tables; and the multiplicity of the relation is indicated by [[multiple]]. - * - * If a relation involves a pivot table, it may be specified by [[via()]] or [[viaTable()]] method. + * ActiveRelationTrait implements the common methods and properties for active record relation classes. * * @author Qiang Xue * @author Carsten Brandt