public function col_select($data) {
        if ($data->status == \tool_dataprivacy\api::DATAREQUEST_STATUS_AWAITING_APPROVAL) {
            if ($data->type == \tool_dataprivacy\api::DATAREQUEST_TYPE_DELETE
                && !api::can_create_data_deletion_request_for_other()) {
                // Don't show checkbox if request's type is delete and user don't have permission.
                return false;
            }

            $stringdata = [
                'username' => $data->foruser->fullname,
                'requesttype' => \core_text::strtolower($data->typenameshort)
            ];

            return \html_writer::checkbox('requestids[]', $data->id, false, '',
                    ['class' => 'selectrequests', 'title' => get_string('selectuserdatarequest',
                    'tool_dataprivacy', $stringdata)]);
        }
    }
public function col_select($data) {
        if ($data->status == \tool_dataprivacy\api::DATAREQUEST_STATUS_AWAITING_APPROVAL) {
            if ($data->type == \tool_dataprivacy\api::DATAREQUEST_TYPE_DELETE
                && !api::can_create_data_deletion_request_for_other()) {
                // Don't show checkbox if request's type is delete and user don't have permission.
                return false;
            }

            $stringdata = [
                'username' => $data->foruser->fullname,
                'requesttype' => \core_text::strtolower($data->typenameshort)
            ];

            return \html_writer::checkbox('requestids[]', $data->id, false, '',
                    ['class' => 'selectrequests', 'title' => get_string('selectuserdatarequest',
                    'tool_dataprivacy', $stringdata)]);
        }
    }
public function col_select ( $ data ) { if ( $ data -> status == \ tool_dataprivacy \ api :: DATAREQUEST_STATUS_AWAITING_APPROVAL ) { if ( $ data -> type == \ tool_dataprivacy \ api :: DATAREQUEST_TYPE_DELETE && ! api :: can_create_data_deletion_request_for_other ( ) ) { // Don't show checkbox if request's type is delete and user don't have permission. return false ; } $ stringdata = [ 'username' => $ data -> foruser -> fullname , 'requesttype' => \ core_text :: strtolower ( $ data -> typenameshort ) ] ; return \ html_writer :: checkbox ( 'requestids[]' , $ data -> id , false , '' , [ 'class' => 'selectrequests' , 'title' => get_string ( 'selectuserdatarequest' , 'tool_dataprivacy' , $ stringdata ) ] ) ; } }
The select column.

@param stdClass $data The row data.
@return string
@throws \moodle_exception
@throws coding_exception
The select column .