original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Validates the model data.
  
  @param array $data
  
  @return boolean
docstring_tokens: Validates the model data .