db\QueryInterface 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 data. The signature of the callable should be:

function ($row)
{
    // return the index value corresponding to $row
}
return $this

The query object itself

doc_Yii
2016-10-30 16:59:26
Comments
Leave a Comment

Please login to continue.