Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-19689

new $strictness parameter in $DB->get_record() DML method

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • 2.0
    • 2.0
    • Database SQL/XMLDB
    • None
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE

      there are very many palces in code like:
      if (!$record = $DB->ger_record('table', $conditions)) {
      print_error('geenralproblem');
      }

      it is usually 66% of wasted lines and one extra language string with information that does not help with real problem solution anyway

      I am proposing to add new method to moodle_database clas
      function get_existing_record($tablename, array $conditions, $errorstring='', $errorcode='', $module='');

      This method would work like get_record() but it would throw new exception.

      Eloy is strongly opposing this because there is nothing like this in standard SQL. Time to vote

            skodak Petr Skoda
            skodak Petr Skoda
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.