summaryrefslogtreecommitdiff
path: root/adodb-xmlschema03.inc.php
diff options
context:
space:
mode:
authorpeterdd <ddpm@liscovius.de>2016-08-04 04:10:12 +0200
committerDamien Regad <dregad@mantisbt.org>2020-01-09 18:00:36 +0100
commitdbff2a1eb4a6be34c03e380099d34b1f3889a409 (patch)
tree7e1e633b55b5158623cc1c2f999bd4c54c08c94c /adodb-xmlschema03.inc.php
parent96326913e5e4979dff1829981384da3df69861ab (diff)
downloadadodb-dbff2a1eb4a6be34c03e380099d34b1f3889a409.tar.gz
adodb-dbff2a1eb4a6be34c03e380099d34b1f3889a409.tar.bz2
adodb-dbff2a1eb4a6be34c03e380099d34b1f3889a409.zip
XML: add support for 'DESCR' tags for tables/fields
Fixes #265 Signed-off-by: Damien Regad <dregad@mantisbt.org> Original commits squashed; commit message reworded; updated changelog.
Diffstat (limited to 'adodb-xmlschema03.inc.php')
-rw-r--r--adodb-xmlschema03.inc.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/adodb-xmlschema03.inc.php b/adodb-xmlschema03.inc.php
index 02c15fd5..2ea49221 100644
--- a/adodb-xmlschema03.inc.php
+++ b/adodb-xmlschema03.inc.php
@@ -347,6 +347,14 @@ class dbTable extends dbObject {
*/
function _tag_cdata( &$parser, $cdata ) {
switch( $this->currentElement ) {
+ // Table or field comment
+ case 'DESCR':
+ if( isset( $this->current_field ) ) {
+ $this->addFieldOpt( $this->current_field, $this->currentElement, $cdata );
+ } else {
+ $this->addTableComment( $cdata );
+ }
+ break;
// Table/field constraint
case 'CONSTRAINT':
if( isset( $this->current_field ) ) {
@@ -511,6 +519,10 @@ class dbTable extends dbObject {
return $this->opts;
}
+ function addTableComment( $opt ) {
+ $this->opts['comment'] = $opt;
+ return $this->opts;
+ }
/**
* Generates the SQL that will create the table in the database