<?php class SoftDeleteBehavior extends ModelBehavior { /** * Default settings * * @var array $default */ public $default = array('deleted' => 'deleted_date'); /** * Holds activity flags for models * * @var array $runtime */ public $runtime = array(); /** * Setup callback * * @param object $model * @param array $settings */ public function setup(&$model, $settings = array()) { if (empty($settings)) { $settings = $this->default; } elseif (!is_array($settings)) { $settings = array($settings); } $error = 'SoftDeleteBehavior::setup(): model ' . $model->alias . ' has no field '; $fields = $this->_normalizeFields($model, $settings)...
Coding Cheatsheets - Learn web development code and tutorials for Software developers which will helps you in project. Get help on JavaScript, PHP, XML, and more.