Entities error on soft delete |
Hi , sorry for english , i have a db table with a foreign key (id_categorie) this is the entities :
Code: <?php If in table categorie the field deleted_at is set i have error in list in this row : Code: <?php foreach ($esami as $row): ?> i want show both non deleted (to delete ) and delete (to reactivate) . How can i do this ?
(12-25-2020, 02:45 AM)pippuccio76 Wrote: Hi , sorry for english , i have a db table with a foreign key (id_categorie) this is the entities : Can someone help me?
1. Try calling withDeleted() method before calling find()
PHP Code: return $model->withDeleted()->find($this->id_categorie); 2. You need to rethink your approach to database queries. I mean queries in a loop. I think it might be worth changing the query to get the Esami array and add JOIN to get the category. For example: PHP Code: // Esami model class |
Welcome Guest, Not a member yet? Register Sign In |