public function get_criteria() {

        if (!$this->_criteria) {
            global $DB;

            $params = array(
                'id'    => $this->criteriaid
            );

            $record = $DB->get_record('course_completion_criteria', $params);

            $this->attach_criteria(completion_criteria::factory((array) $record));
        }

        return $this->_criteria;
    }
public function get_criteria() {

        if (!$this->_criteria) {
            global $DB;

            $params = array(
                'id'    => $this->criteriaid
            );

            $record = $DB->get_record('course_completion_criteria', $params);

            $this->attach_criteria(completion_criteria::factory((array) $record));
        }

        return $this->_criteria;
    }
public function get_criteria ( ) { if ( ! $ this -> _criteria ) { global $ DB ; $ params = array ( 'id' => $ this -> criteriaid ) ; $ record = $ DB -> get_record ( 'course_completion_criteria' , $ params ) ; $ this -> attach_criteria ( completion_criteria :: factory ( ( array ) $ record ) ) ; } return $ this -> _criteria ; }
Return the associated criteria with this completion
If nothing attached, load from the db

@return completion_criteria
Return the associated criteria with this completion If nothing attached load from the db