tattersoftware / codeigniter4-relations

Entity relationships for CodeIgniter 4
MIT License
87 stars 20 forks source link

trouble using relation in app with shield framework for CI4 #48

Closed foxbille closed 5 months ago

foxbille commented 9 months ago

Hello, I got : Error Cannot instantiate abstract class CodeIgniter\Shield\Models\BaseModel IN : VENDORPATH/tatter/schemas/src/Drafter/Handlers/ModelHandler.php at line 173

when trying to fetch data thru ->with() clause. I add modelTrait in model, like this :

class AlbumModel extends Model
{
    use \Tatter\Relations\Traits\ModelTrait;

and in controller/method i add :

$albums = $model->with('artists')->findAll();

This line fires the error. Same code was working fine in an app without Shield framework Difference is Shield and the fact that Albums and Artists tables are linked thru AlbumsAtrists relation table. And that was not like that in my other app where "relations" works fine. Can i have some help ? Thanks a lot Eric Maybe i'm wrong to post here instead of Discussions tab, let me know