public function get_cm_sql() {
        $joins = array();
        $params = array();

        if ($this->filterparams->logreader instanceof logstore_legacy\log\store) {
            // The legacy store doesn't support context level.
            $joins[] = "cmid = :cmid";
            $params['cmid'] = $this->filterparams->modid;
        } else {
            $joins[] = "contextinstanceid = :contextinstanceid";
            $joins[] = "contextlevel = :contextmodule";
            $params['contextinstanceid'] = $this->filterparams->modid;
            $params['contextmodule'] = CONTEXT_MODULE;
        }

        $sql = implode(' AND ', $joins);
        return array($sql, $params);
    }
public function get_cm_sql() {
        $joins = array();
        $params = array();

        if ($this->filterparams->logreader instanceof logstore_legacy\log\store) {
            // The legacy store doesn't support context level.
            $joins[] = "cmid = :cmid";
            $params['cmid'] = $this->filterparams->modid;
        } else {
            $joins[] = "contextinstanceid = :contextinstanceid";
            $joins[] = "contextlevel = :contextmodule";
            $params['contextinstanceid'] = $this->filterparams->modid;
            $params['contextmodule'] = CONTEXT_MODULE;
        }

        $sql = implode(' AND ', $joins);
        return array($sql, $params);
    }
public function get_cm_sql ( ) { $ joins = array ( ) ; $ params = array ( ) ; if ( $ this -> filterparams -> logreader instanceof logstore_legacy \ log \ store ) { // The legacy store doesn't support context level. $ joins [ ] = "cmid = :cmid" ; $ params [ 'cmid' ] = $ this -> filterparams -> modid ; } else { $ joins [ ] = "contextinstanceid = :contextinstanceid" ; $ joins [ ] = "contextlevel = :contextmodule" ; $ params [ 'contextinstanceid' ] = $ this -> filterparams -> modid ; $ params [ 'contextmodule' ] = CONTEXT_MODULE ; } $ sql = implode ( ' AND ' , $ joins ) ; return array ( $ sql , $ params ) ; }
Helper function which is used by build logs to get course module sql and param.

@return array sql and param for action.
Helper function which is used by build logs to get course module sql and param .