Delete Multi Childs Of Rows

hi ,

how can i delete row and this row have childs and every child has another childs ?

can i do that using beforedelete because i dont need by database?

Hi mahmoud!

if the childs is a relation with parent AR you could use afterDelete method of parent and in order, override the afterDelete of child model to delete with same way (and so on)

if the childs is not another AR you should do it with recursive function passing each time the id of child