protected static function transform_evidence($userid, evidence $evidence, competency $competency, performance_helper $helper) {
        $action = $evidence->get('action');
        $actiontxt = '?';
        if ($action == evidence::ACTION_LOG) {
            $actiontxt = get_string('privacy:evidence:action:log', 'core_competency');
        } else if ($action == evidence::ACTION_COMPLETE) {
            $actiontxt = get_string('privacy:evidence:action:complete', 'core_competency');
        } else if ($action == evidence::ACTION_OVERRIDE) {
            $actiontxt = get_string('privacy:evidence:action:override', 'core_competency');
        }

        $actionuserid = $evidence->get('actionuserid');

        return [
            'action' => $actiontxt,
            'actionuserid' => $actionuserid ? transform::user($actionuserid) : '-',
            'acting_user_is_you' => transform::yesno($userid == $actionuserid),
            'description' => (string) $evidence->get_description(),
            'url' => $evidence->get('url'),
            'grade' => static::transform_competency_grade($competency, $evidence->get('grade'), $helper),
            'note' => $evidence->get('note'),
            'timecreated' => transform::datetime($evidence->get('timecreated')),
            'timemodified' => transform::datetime($evidence->get('timemodified')),
            'created_or_modified_by_you' => transform::yesno($userid == $evidence->get('usermodified'))
        ];
    }
protected static function transform_evidence($userid, evidence $evidence, competency $competency, performance_helper $helper) {
        $action = $evidence->get('action');
        $actiontxt = '?';
        if ($action == evidence::ACTION_LOG) {
            $actiontxt = get_string('privacy:evidence:action:log', 'core_competency');
        } else if ($action == evidence::ACTION_COMPLETE) {
            $actiontxt = get_string('privacy:evidence:action:complete', 'core_competency');
        } else if ($action == evidence::ACTION_OVERRIDE) {
            $actiontxt = get_string('privacy:evidence:action:override', 'core_competency');
        }

        $actionuserid = $evidence->get('actionuserid');

        return [
            'action' => $actiontxt,
            'actionuserid' => $actionuserid ? transform::user($actionuserid) : '-',
            'acting_user_is_you' => transform::yesno($userid == $actionuserid),
            'description' => (string) $evidence->get_description(),
            'url' => $evidence->get('url'),
            'grade' => static::transform_competency_grade($competency, $evidence->get('grade'), $helper),
            'note' => $evidence->get('note'),
            'timecreated' => transform::datetime($evidence->get('timecreated')),
            'timemodified' => transform::datetime($evidence->get('timemodified')),
            'created_or_modified_by_you' => transform::yesno($userid == $evidence->get('usermodified'))
        ];
    }
protected static function transform_evidence ( $ userid , evidence $ evidence , competency $ competency , performance_helper $ helper ) { $ action = $ evidence -> get ( 'action' ) ; $ actiontxt = '?' ; if ( $ action == evidence :: ACTION_LOG ) { $ actiontxt = get_string ( 'privacy:evidence:action:log' , 'core_competency' ) ; } else if ( $ action == evidence :: ACTION_COMPLETE ) { $ actiontxt = get_string ( 'privacy:evidence:action:complete' , 'core_competency' ) ; } else if ( $ action == evidence :: ACTION_OVERRIDE ) { $ actiontxt = get_string ( 'privacy:evidence:action:override' , 'core_competency' ) ; } $ actionuserid = $ evidence -> get ( 'actionuserid' ) ; return [ 'action' => $ actiontxt , 'actionuserid' => $ actionuserid ? transform :: user ( $ actionuserid ) : '-' , 'acting_user_is_you' => transform :: yesno ( $ userid == $ actionuserid ) , 'description' => ( string ) $ evidence -> get_description ( ) , 'url' => $ evidence -> get ( 'url' ) , 'grade' => static :: transform_competency_grade ( $ competency , $ evidence -> get ( 'grade' ) , $ helper ) , 'note' => $ evidence -> get ( 'note' ) , 'timecreated' => transform :: datetime ( $ evidence -> get ( 'timecreated' ) ) , 'timemodified' => transform :: datetime ( $ evidence -> get ( 'timemodified' ) ) , 'created_or_modified_by_you' => transform :: yesno ( $ userid == $ evidence -> get ( 'usermodified' ) ) ] ; }
Transform an evidence.

@param int $userid The user ID we are exporting for.
@param evidence $evidence The evidence.
@param competency $competency The associated competency.
@param performance_helper $helper The performance helper.
@return array
Transform an evidence .