Fixed variable reference

This commit is contained in:
Jose Lorenzo Rodriguez 2012-04-28 20:05:41 -04:30
parent 3ea2d7bca5
commit 4519ba1221

View file

@ -3355,11 +3355,11 @@ class Model extends Object implements CakeEventListener {
* @return ModelValidator
*/
public function validator($instance = null) {
if ($validator instanceof ModelValidator) {
return $this->_validator = $validator;
if ($instance instanceof ModelValidator) {
return $this->_validator = $instance;
}
if (is_null($validator) && is_null($this->validatorClass)) {
if (is_null($instance) && is_null($this->validatorClass)) {
$this->_validator = new ModelValidator($this);
}