Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Find deleted in relation
  • Exactly i found the delete execute where('id','IS NOT',null).. but how i found it on relation

    \Model_Institute::deleted() works fine.
    finding all deleted values in Institutes

    but i want deleted executed on students, which is relation of institute. \Model_Student::deleted() works, but it is not good, i need it to be fetched from parent.
  • if you want delete Institute with all Student, use cascade_delete in model or use foreign key with cascade in tables.
  • It is ok, it is just related to Soft Delete, if students are deleted, i want to get deleted students by relation,
    eg.

    Model_parent::query()->related('child')->deleted(); is ok?
  • I don't have any setup with Soft Delete around but I believe that this isn't supported out-of-the-box meaning you would have to run a manual query on the table that contains the deleted rows. If you run this with the proper query options and relate it against the parent model, you should be able to find what you need.
    Because, as I said, there is no "get all deleted items of this model's child models" method. But maybe I'm wrong... Maybe you also want to read through the docs, the source code, or ask Steve/uru on IRC.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion