Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.
/lib/ -> ddllib.php (source)

Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401] [Versions 400 and 401]

This library includes all the required functions used to handle the DB structure (DDL) independently of the underlying RDBMS in use. This library includes all the required functions used to handle the DB structure (DDL) independently of the underlying RDBMS in use. All the functions rely on the XMLDBDriver classes to be able to generate the correct SQL syntax needed by each DB.

Copyright: 2001-3001 Eloy Lafuente (stronk7) http://contiento.com
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 149 lines (5 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 5 classes

ddl_exception:: (1 method):
  __construct()

ddl_table_missing_exception:: (1 method):
  __construct()

ddl_field_missing_exception:: (1 method):
  __construct()

ddl_change_structure_exception:: (1 method):
  __construct()

ddl_dependency_exception:: (1 method):
  __construct()


Class: ddl_exception  - X-Ref

DDL exception class, use instead of throw new \moodle_exception() and "return false;" in ddl code.

__construct($errorcode, $a=NULL, $debuginfo=null)   X-Ref

param: string $errorcode
param: string $debuginfo

Class: ddl_table_missing_exception  - X-Ref

Table does not exist problem exception

__construct($tablename, $debuginfo=null)   X-Ref

param: string $tablename
param: string $debuginfo

Class: ddl_field_missing_exception  - X-Ref

Table does not exist problem exception

__construct($fieldname, $tablename, $debuginfo=null)   X-Ref

param: string $fieldname
param: string $tablename
param: string $debuginfo

Class: ddl_change_structure_exception  - X-Ref

Error during changing db structure

__construct($error, $sql=null)   X-Ref

param: string $error
param: string $sql

Class: ddl_dependency_exception  - X-Ref

Error changing db structure, caused by some dependency found
like trying to modify one field having related indexes.