 Hey everybody, it's Brian. Welcome to the 14th yeet tutorial. Alright, today we're going to be talking about the difference between find, find all, and see active data provider. This is kind of a little bit leaning into more of an advanced topic, but I think we're there. So if you've been following along, we are just simply displaying a model. Let's go ahead and jump into the code here. And we're just using the find, meaning we're finding a single record. Find all is actually extremely easy to understand. Find all, well, finds all the records that meet whatever criteria you plug into it. And if you give it no criteria, it'll just find all the records. So we're gonna say find all, instead of John, we're gonna change it to Slardy. Because, well, we've got multiple records in here that have Slardy as a first name. Hitchhiker guide to the galaxy reference. And let's actually just jump back out to here. And if you hit enter, you notice how first it starts off with an array. So that's a light bulb moment. You're like, Aha, it's just an array of items. Well, you're right. That's all it is. So you can actually go into the view. Let's comment that out for each model's item. I just echo out the primary key here. Let's jump back to our page. And sure enough, 10 and 11. Those are the primary keys of Slardy. 10 and 11. So that's find all. Now you may be jumping ahead a little bit here. And this is why I want to do a tutorial. And if you're looking at, like, index or manage, you're sitting here going, Oh, I see how that works. It's just an array. So you're inclined to go out to let's just open up index here and take this little guy. And let's delete this. And oh, yeah, spotted a problem. So we're going to change this to model. And let's go back out to our page and it will go to test. It does not work. This is a typical ye problem. Or I should say a PHP problem where if you don't have PHP configured, it won't show you the error message. So what's going on here? Why isn't this working? I mean, you think in theory that would work. Notice how it's data provider. And what that is is it takes a different class, a C active data provider. And this can be a little bit frustrating sometimes. But basically what C active data provider is is a class that encapsulates the find all method. You can see C active data provider provides data in terms of active record objects, which are class model class. It uses the AR C active, you know, the find all method basically to retrieve from the database. The criteria can be used to specify the query options. It's got a nice little example here. So you can say C active data provider. And then you're going to give it different conditions here. And you can set the order and you can page eight and do all these other things. So this really gets into more of an advanced topic. But I wanted to bring it to your attention before you start diving too much in. And I'm going to devote an entire tutorial to the C active data provider because it does get a little bit complex here. But you can see how you can set a condition like status equal one, order. You can set the order of different items. And you can, you know, with means you can actually join tables. Yeah, it's pretty slick. That's why it's an entirely separate class. So rather than trying to glue together all the SQL statements, it actually encapsulate into a nice object oriented method. Now, just to get this example working for this tutorial, let's actually jump in here and go to the index. And you see how we're just doing data provider teachers. And let's go back up here. Let's kind of comment that out. And let's rename it here model. Normally you'd leave it as data providers, but we're going to leave it as model. And go here. And voila, it's only works because we're passing the correct type. Instead of array, it's hard typed as C active data provider. So that and a nutshell is how that works. We're going to be covering C active data provider in future tutorials. I just really wanted to give you a quick overview of the differences between the three.