Entities not uses by model with custom model method |
Hy everyone,
I'm new on this forum, and totally novice on CI4. I've been working on CI2 for soooo manu years and on CI3 since 2019, but, with CI4, it's a new world opening to me !!! I am discovering the Entities concept, it looks vers convenient but I'm really not comfortable with it even if I read the documentation about Model's and Entities. Here's my problem : I've got a simple model "PaysModel" (countries), it works with Pays entity. When I call A find() or findAll() method, it works find. But, I need to modify the findAll() behavior : actually I need all countries with "France" in first position. So, in order to do that, I've tryied 2 things : - Create a findAll() method in my model - Create a findAll2() (juste for the test) in my model. Both of them works find but don't return Entities. Could anybony explain me why and what to do ? Actually I want my method to return an array of row where each rows in an entity of Pays. This is my model : PHP Code: namespace App\Models; Here is my Entity : PHP Code: namespace App\Entities; And here is the way my call in controller : PHP Code: use App\Models\PaysModel; |
Messages In This Thread |
Entities not uses by model with custom model method - by Robin Rumeau - 07-26-2021, 12:27 AM
RE: Entities not uses by model with custom model method - by includebeer - 07-29-2021, 10:01 AM
|