db\ActiveQueryTrait findWith()

findWith() public method Finds records corresponding to one or multiple relations and populates them into the primary models. public void findWith ( $with, &$models )$with array A list of relations that this query should be performed with. Please refer to with() for details about specifying this parameter. $models array|yii\db\ActiveRecord[] The primary models (can be either AR instances or arrays)

db\ActiveQueryTrait asArray()

asArray() public method Sets the asArray() property. public $this asArray ( $value = true )$value boolean Whether to return the query results in terms of arrays instead of Active Records. return $this The query object itself

db\ActiveQueryTrait $with

$with public property A list of relations that this query should be performed with public array $with = null

db\ActiveQueryTrait $modelClass

$modelClass public property The name of the ActiveRecord class. public string $modelClass = null

db\ActiveQueryTrait $asArray

$asArray public property Whether to return each record as an array. If false (default), an object of $modelClass will be created to represent each record. public boolean $asArray = null

db\ActiveQueryInterface with()

with() public abstract method Specifies the relations with which this query should be performed. The parameters to this method can be either one or multiple strings, or a single array of relation names and the optional callbacks to customize the relations. A relation name can refer to a relation defined in modelClass or a sub-relation that stands for a relation of a related record. For example, orders.address means the address relation defined in the model class corresponding to the orders

db\ActiveQueryInterface via()

via() public abstract method Specifies the relation associated with the junction table for use in relational query. public abstract $this via ( $relationName, callable $callable = null )$relationName string The relation name. This refers to a relation declared in the primaryModel of the relation. $callable callable A PHP callback for customizing the relation associated with the junction table. Its signature should be function($query), where $query is the query to be customized. return

db\ActiveQueryInterface one()

one() public abstract method Executes query and returns a single row of result. public abstract yii\db\ActiveRecordInterface|array|null one ( $db = null )$db yii\db\Connection The DB connection used to create the DB command. If null, the DB connection returned by \yii\db\modelClass will be used. return yii\db\ActiveRecordInterface|array|null A single row of query result. Depending on the setting of asArray(), the query result may be either an array or an ActiveRecord object. null wil

db\ActiveQueryInterface indexBy()

indexBy() public abstract method Sets the indexBy() property. public abstract $this indexBy ( $column )$column string|callable 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: // $model is an AR instance when `asArray` is false, // or an array of column values when `asArray` is true. function ($model) {

db\ActiveQueryInterface findFor()

findFor() public abstract method 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. public abstract mixed findFor ( $name, $model )$name string The relation name $model yii\db\ActiveRecordInterface The primary model return mixed The related record(s)