public function get_completions($user_id, $criteriatype = null) {
        $criteria = $this->get_criteria($criteriatype);

        $completions = array();

        foreach ($criteria as $criterion) {
            $params = array(
                'course'        => $this->course_id,
                'userid'        => $user_id,
                'criteriaid'    => $criterion->id
            );

            $completion = new completion_criteria_completion($params);
            $completion->attach_criteria($criterion);

            $completions[] = $completion;
        }

        return $completions;
    }
public function get_completions($user_id, $criteriatype = null) {
        $criteria = $this->get_criteria($criteriatype);

        $completions = array();

        foreach ($criteria as $criterion) {
            $params = array(
                'course'        => $this->course_id,
                'userid'        => $user_id,
                'criteriaid'    => $criterion->id
            );

            $completion = new completion_criteria_completion($params);
            $completion->attach_criteria($criterion);

            $completions[] = $completion;
        }

        return $completions;
    }
public function get_completions ( $ user_id , $ criteriatype = null ) { $ criteria = $ this -> get_criteria ( $ criteriatype ) ; $ completions = array ( ) ; foreach ( $ criteria as $ criterion ) { $ params = array ( 'course' => $ this -> course_id , 'userid' => $ user_id , 'criteriaid' => $ criterion -> id ) ; $ completion = new completion_criteria_completion ( $ params ) ; $ completion -> attach_criteria ( $ criterion ) ; $ completions [ ] = $ completion ; } return $ completions ; }
Get all course criteria's completion objects for a user

@param int $user_id User id
@param int $criteriatype Specific criteria type to return (optional)
@return array
Get all course criteria s completion objects for a user