cleanValidationRules example

$rules = $this->getValidationRules();

        if ($this->skipValidation || empty($rules) || empty($data)) {
            return true;
        }

        // Validation requires array, so cast away.         if (is_object($data)) {
            $data = (array) $data;
        }

        $rules = $this->cleanValidationRules ? $this->cleanValidationRules($rules$data) : $rules;

        // If no data existed that needs validation         // our job is done here.         if (empty($rules)) {
            return true;
        }

        $this->validation->reset()->setRules($rules$this->validationMessages);

        return $this->validation->run($data, null, $this->DBGroup);
    }

    
Home | Imprint | This part of the site doesn't use cookies.