mirror of
https://github.com/yiisoft/yii2.git
synced 2026-03-13 02:37:38 +01:00
@@ -24,16 +24,16 @@ interface ActiveQueryInterface extends QueryInterface
|
||||
{
|
||||
/**
|
||||
* Sets the [[asArray]] property.
|
||||
* @param boolean $value whether to return the query results in terms of arrays instead of Active Records.
|
||||
* @return static the query object itself
|
||||
* @param boolean $value whether to return the query results in terms of arrays instead of Active Records.
|
||||
* @return static the query object itself
|
||||
*/
|
||||
public function asArray($value = true);
|
||||
|
||||
/**
|
||||
* Sets the [[indexBy]] property.
|
||||
* @param string|callable $column the name of the column by which the query results should be indexed by.
|
||||
* This can also be a callable (e.g. anonymous function) that returns the index value based on the given
|
||||
* row or model data. The signature of the callable should be:
|
||||
* This can also be a callable (e.g. anonymous function) that returns the index value based on the given
|
||||
* row or model data. The signature of the callable should be:
|
||||
*
|
||||
* ~~~
|
||||
* // $model is an AR instance when `asArray` is false,
|
||||
@@ -81,19 +81,19 @@ interface ActiveQueryInterface extends QueryInterface
|
||||
|
||||
/**
|
||||
* Specifies the relation associated with the pivot table for use in relational query.
|
||||
* @param string $relationName the relation name. This refers to a relation declared in the [[ActiveRelationTrait::primaryModel|primaryModel]] of the relation.
|
||||
* @param callable $callable a PHP callback for customizing the relation associated with the pivot table.
|
||||
* Its signature should be `function($query)`, where `$query` is the query to be customized.
|
||||
* @return static the relation object itself.
|
||||
* @param string $relationName the relation name. This refers to a relation declared in the [[ActiveRelationTrait::primaryModel|primaryModel]] of the relation.
|
||||
* @param callable $callable a PHP callback for customizing the relation associated with the pivot table.
|
||||
* Its signature should be `function($query)`, where `$query` is the query to be customized.
|
||||
* @return static the relation object itself.
|
||||
*/
|
||||
public function via($relationName, $callable = null);
|
||||
|
||||
/**
|
||||
* Finds the related records for the specified primary record.
|
||||
* This method is invoked when a relation of an ActiveRecord is being accessed in a lazy fashion.
|
||||
* @param string $name the relation name
|
||||
* @param ActiveRecordInterface $model the primary model
|
||||
* @return mixed the related record(s)
|
||||
* @param string $name the relation name
|
||||
* @param ActiveRecordInterface $model the primary model
|
||||
* @return mixed the related record(s)
|
||||
*/
|
||||
public function findFor($name, $model);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user