yii\db\ActiveQuery::all PHP Method

all() public method

Executes query and returns all results as an array.
public all ( Connection $db = null ) : array | ActiveRecord[]
$db Connection the DB connection used to create the DB command. If null, the DB connection returned by [[modelClass]] will be used.
return array | ActiveRecord[] the query results. If the query results in nothing, an empty array will be returned.
    public function all($db = null)
    {
        return parent::all($db);
    }

Usage Example

Example #1
0
 /**
  * @inheritdoc
  */
 public function run()
 {
     $countQuery = clone $this->query;
     $pagination = new \yii\data\Pagination(['totalCount' => $countQuery->count(), 'pageSize' => $this->pageSize]);
     $this->query->offset($pagination->offset)->limit($pagination->limit);
     return $this->render("userListBox", ['title' => $this->title, 'users' => $this->query->all(), 'pagination' => $pagination]);
 }
All Usage Examples Of yii\db\ActiveQuery::all