Difference between #5 and #6 of
Handling recursive deletion in Yii

Revision #6 has been created by JamesBarnsley on Dec 23, 2012, 1:56:10 PM with the memo:

Just updated link to my website, thought I may aswell make it a link
« previous (#5) next (#7) »

Changes

Title unchanged

Handling recursive deletion in Yii

Category unchanged

How-tos

Yii version unchanged

Tags unchanged

recursive, deletion, delete

Content changed

As a lead developer at [Mutable Labs](http://www.mutablelabs.com "Mutable Labs") I was tasked to find a way to do recursive deletion in Yii. As I asked other developers and looked around the internet the usual answers all came up, use a plugin or use cascade delete at the DB level, but I did not want to do either of these.

So I came up with my own solution which I found to be simple and effective. It all starts off by adding a function to your global model, if you do not have one of these then create one. Create a model that extends active record and then make sure your other models extend the global model. This creates a nice place to put global model functions which can be used by any model in your application.

Add this function to the global model ...
[...]
3 0
5 followers
Viewed: 16 271 times
Version: 1.1
Category: How-tos
Written by: JamesBarnsley
Last updated by: JamesBarnsley
Created on: Dec 19, 2012
Last updated: 8 years ago
Update Article

Revisions

View all history