mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-06-18 02:59:27 +00:00
add new method getValueSetSeparator()
This commit is contained in:
parent
5658cbbe54
commit
e0880e8ebd
|
@ -545,6 +545,20 @@ class SeedDMS_Core_AttributeDefinition { /* {{{ */
|
||||||
return $this->_valueset;
|
return $this->_valueset;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the separator used for the value set
|
||||||
|
*
|
||||||
|
* This is the first char of the value set string.
|
||||||
|
*
|
||||||
|
* @return string separator or an empty string if a value set is not set
|
||||||
|
*/
|
||||||
|
function getValueSetSeparator() { /* {{{ */
|
||||||
|
if(strlen($this->_valueset) > 1)
|
||||||
|
return $this->_valueset[0];
|
||||||
|
else
|
||||||
|
return '';
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the whole value set as an array
|
* Get the whole value set as an array
|
||||||
*
|
*
|
||||||
|
@ -594,7 +608,12 @@ class SeedDMS_Core_AttributeDefinition { /* {{{ */
|
||||||
}
|
}
|
||||||
$valuesetstr = implode(",", $tmp);
|
$valuesetstr = implode(",", $tmp);
|
||||||
*/
|
*/
|
||||||
$valuesetstr = $valueset;
|
if(trim($valueset)) {
|
||||||
|
$valuesetarr = array_map('trim', explode($valueset[0], substr($valueset, 1)));
|
||||||
|
$valuesetstr = $valueset[0].implode($valueset[0], $valuesetarr);
|
||||||
|
} else {
|
||||||
|
$valuesetstr = '';
|
||||||
|
}
|
||||||
|
|
||||||
$db = $this->_dms->getDB();
|
$db = $this->_dms->getDB();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user