public function validates($data = null)
    {
        $this->errors = array();

        // Get data if it wasn't passed
        if ($data === null) {
            $data = $this->data();
        }

        foreach (static::$_validates as $field => $validations) {
            Validations::run($this, $field, $validations);
        }

        return count($this->errors) == 0;
    }
public function validates($data = null)
    {
        $this->errors = array();

        // Get data if it wasn't passed
        if ($data === null) {
            $data = $this->data();
        }

        foreach (static::$_validates as $field => $validations) {
            Validations::run($this, $field, $validations);
        }

        return count($this->errors) == 0;
    }
public function validates ( $ data = null ) { $ this -> errors = array ( ) ; // Get data if it wasn't passed if ( $ data === null ) { $ data = $ this -> data ( ) ; } foreach ( static :: $ _validates as $ field => $ validations ) { Validations :: run ( $ this , $ field , $ validations ) ; } return count ( $ this -> errors ) == 0 ; }
Validates the model data.

@param array $data

@return boolean
Validates the model data .