public static function count_lti_tools($params = array()) {
        global $DB;

        $sql = "SELECT COUNT(*)
                  FROM {enrol_lti_tools} elt
                  JOIN {enrol} e
                    ON elt.enrolid = e.id";
        if ($params) {
            $where = "WHERE";
            foreach ($params as $colname => $value) {
                $sql .= " $where $colname = :$colname";
                $where = "AND";
            }
        }

        return $DB->count_records_sql($sql, $params);
    }
public static function count_lti_tools($params = array()) {
        global $DB;

        $sql = "SELECT COUNT(*)
                  FROM {enrol_lti_tools} elt
                  JOIN {enrol} e
                    ON elt.enrolid = e.id";
        if ($params) {
            $where = "WHERE";
            foreach ($params as $colname => $value) {
                $sql .= " $where $colname = :$colname";
                $where = "AND";
            }
        }

        return $DB->count_records_sql($sql, $params);
    }
public static function count_lti_tools ( $ params = array ( ) ) { global $ DB ; $ sql = "SELECT COUNT(*)
                  FROM {enrol_lti_tools} elt
                  JOIN {enrol} e
                    ON elt.enrolid = e.id" ; if ( $ params ) { $ where = "WHERE" ; foreach ( $ params as $ colname => $ value ) { $ sql .= " $where $colname = :$colname" ; $ where = "AND" ; } } return $ DB -> count_records_sql ( $ sql , $ params ) ; }
Returns the number of LTI tools.

@param array $params The list of SQL params (eg. array('columnname' => value, 'columnname2' => value)).
@return int The number of tools
Returns the number of LTI tools .