Yii\db\query limit 20 automatically set when use yii\data\ActiveDataProvider

Hello Guys,
i have an issue in my code. When i create the query for my ActiveDataProvider it will found only 20 rows instead of 41. Someone con help me getting all of these rows from my DB? (i use the limit clause but it isn’t work…) Hera are the code and the display from the var_dump

  public function getCodiciAssiemi (){
      $query = (new Query())
      ->select('Codice')
      ->from('macchina')
      ->where(['like', 'Descrizione',  'As.']);


      $query->limit(100);


      $dataProvider = new ActiveDataProvider([
          'query' => $query
        ]);
      $array = $dataProvider->getModels();
      $codiciAssiemi;

pageSize will be 20 if not set.

https://www.yiiframework.com/doc/api/2.0/yii-data-activedataprovider

https://www.yiiframework.com/doc/api/2.0/yii-data-pagination#$pageSize-detail

2 Likes

THX so much!