Active Query Limit

Hey, I’m trying to build an ActiveDataProvider, and the ActiveQuery that I’m creating is not setting the limit in SQL:

$query = ClassName::find()->orderBy('date DESC, id DESC')->limit(3);

It simply ignores the limit, and sets the limit to 20.

Any help please? Thank you.

Fixed. I was using it in a ActiveDataProvider, and the pagination object was overwriting the limit set in ActiveQuery. Setting pagination object to false in ActiveDataProvider solved the problem.