From 0a0ea79d7d08acdd6cf0225c9c1c644e587a4f5c Mon Sep 17 00:00:00 2001 From: skodak Date: Sun, 25 May 2008 22:21:01 +0000 Subject: [PATCH] MDL-14957 get_columns() improvements - mostly docs; definition moved to new file --- lib/dml/database_column_info.php | 112 +++++++++++++++++++++++++++++++ lib/dml/moodle_database.php | 2 + lib/dmllib.php | 34 ---------- 3 files changed, 114 insertions(+), 34 deletions(-) create mode 100644 lib/dml/database_column_info.php diff --git a/lib/dml/database_column_info.php b/lib/dml/database_column_info.php new file mode 100644 index 0000000000..dec7195509 --- /dev/null +++ b/lib/dml/database_column_info.php @@ -0,0 +1,112 @@ +$value) { + if (array_key_exists($key, $this)) { + $this->$key = $value; + } + } + } +} diff --git a/lib/dml/moodle_database.php b/lib/dml/moodle_database.php index 6dcbcc2a4f..5d08d93a3e 100644 --- a/lib/dml/moodle_database.php +++ b/lib/dml/moodle_database.php @@ -1,5 +1,7 @@ libdir.'/dml/database_column_info.php'); + /** * Abstract class representing moodle database interface. * @package dmlib diff --git a/lib/dmllib.php b/lib/dmllib.php index e2875451ab..f646c56e34 100644 --- a/lib/dmllib.php +++ b/lib/dmllib.php @@ -138,40 +138,6 @@ function setup_DB() { return true; } -/** - * Detail database field information. - * Based on ADOFieldObject. - */ -class database_column_info { - public $name; - public $type; // raw db field type - public $max_length; - public $scale; - public $enums; - public $not_null; - public $primary_key; - public $auto_increment; - public $binary; - public $unsigned; - public $zerofill; - public $has_default; - public $default_value; - public $unique; - - public $meta_type; // type as one character - - /** - * Contructor - * @param $data mixed object or array with properties - */ - public function database_column_info($data) { - foreach ($data as $key=>$value) { - if (array_key_exists($key, $this)) { - $this->$key = $value; - } - } - } -} -- 2.39.5