logical-deletion This feature would replace $model->delete() calls when data needs to be preserved

  1. Summary
  2. Example of controller code:
  3. Links

Summary

Replaces delete() call with softDelete() so that delete is not permanent. Supports multiple column names to indicate a column should be 'deleted', or, not shown in the application. For instance: visible, deleted; both serve the same purpose but must be set accordingly.

This feature requires that:

  • every model extend ActiveRecord instead of CActiveRecord
  • controllers which currently use $model->delete() can now use $model->softDelete()
  • assumes field names 'active', 'visible', and 'active' are functional equivalents which determine if a value is shown or not (treated as deleted)

Example of controller code:

// existing code
//$this->loadModel($id)->delete();

// new code
$this->loadModel($id)->softDelete();

Links

Project Page

0 0
2 followers
158 downloads
Yii Version: 1.1
License: MIT
Category: Database
Developed by: cottonaf
Created on: May 21, 2015
Last updated: 4 years ago

Downloads

show all