<?php
class Customer extends AppModel{
     public $validate = array(
        'mobile' => array(
            'isUnique' => array(
                'rule' => array('isUnique', 'mobile'),
                'on' => 'create',
                'message' => 'This Contact no is already in use.')
            ),           
            
          
        'email' => array(                
                'isUnique' => array(
                'rule' => array('isUnique', 'email'),
                'on' => 'create',
                'message' => 'This email is already in use.'))
        );

	 function activedelete($id) {
        $this->id = $id;
        $customer = $this->read(null, $id);
        if ($customer['Customer']['is_delete'] == 1) {
            $this->saveField('is_delete', 0);
        } else {
            $this->saveField('is_delete', 1);
        }

        return ($customer['Customer']['is_delete'] == 1) ? 0 : 1;
    }
}

?>