Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
can you explain this?
Your table schema defines classes_id as a required field (NOT NULL), and your value array for the insert doesn't contain a value.
yeah but can you give me a reason why there's an insert data?
i just want to delete record
From the looks of it, your $xclasses object contains new related objects. So ORM will insert that first.
The fact that you delete a parent doesn't directly mean you want to delete all related objects too. You need to enable cascade_delete on the relation if you want to automatically delete related child objects of that relation.
when i enable cascade_delete, is the ORM Model trigger observer delete when the child record deleted?
No, you define it on the relation. So when you delete the parent, it will delete associated children.
If you don't want that, it will have to reset the foreign key of all related childeren to NULL (since you are deleting the record the foreign key points to), which with your constraint will be a problem too.
And it doesn't work recusive.
So it will not delete the childeren's childeren, unless that relation also has a cascade_delete defined on it.
Add a Comment
It looks like you're new here. If you want to get involved, click one of these buttons!
Apply for Membership
↳ Job Board
↳ Installation & Setup
↳ Tips and Tutorials
↳ Code share
In this Discussion