original_string: final public function read() {
          global $DB;
  
          if ($this->get('id') <= 0) {
              throw new coding_exception('id is required to load');
          }
          $record = $DB->get_record(static::TABLE, array('id' => $this->get('id')), '*', MUST_EXIST);
          $this->from_record($record);
  
          // Validate the data as it comes from the database.
          $this->validated = true;
  
          return $this;
      }
code: final public function read() {
          global $DB;
  
          if ($this->get('id') <= 0) {
              throw new coding_exception('id is required to load');
          }
          $record = $DB->get_record(static::TABLE, array('id' => $this->get('id')), '*', MUST_EXIST);
          $this->from_record($record);
  
          // Validate the data as it comes from the database.
          $this->validated = true;
  
          return $this;
      }
code_tokens: final public function read ( ) { global $ DB ; if ( $ this -> get ( 'id' ) <= 0 ) { throw new coding_exception ( 'id is required to load' ) ; } $ record = $ DB -> get_record ( static :: TABLE , array ( 'id' => $ this -> get ( 'id' ) ) , '*' , MUST_EXIST ) ; $ this -> from_record ( $ record ) ; // Validate the data as it comes from the database. $ this -> validated = true ; return $ this ; }
docstring: Load the data from the DB.
  
  @return persistent
docstring_tokens: Load the data from the DB .