fixed and close #15

This commit is contained in:
o.pinke 2021-06-11 08:34:24 +02:00
parent 8278e52a89
commit 603ce348eb
1 changed files with 23 additions and 11 deletions

View File

@ -706,24 +706,36 @@ abstract class ItemCollection extends cItemBaseAbstract {
/**
* Adds a result field
* @param string $sField
* @param string|array $mField
*/
public function addResultField($sField) {
$sField = strtolower($sField);
if (!in_array($sField, $this->_resultFields)) {
$this->_resultFields[] = $sField;
public function addResultField($mField) {
if (!is_array($mField)) {
$mField = array($mField);
}
foreach ($mField as $sField) {
$sField = strtolower($sField);
if (!in_array($sField, $this->_resultFields)) {
$this->_resultFields[] = $sField;
}
}
}
/**
* Removes existing result field
* @param string $sField
* @param string|array $mField
*/
public function removeResultField($sField) {
$sField = strtolower($sField);
$key = array_search($sField, $this->_resultFields);
if ($key !== false) {
unset($this->_resultFields[$key]);
public function removeResultField($mField) {
if (!is_array($mField)) {
$mField = array($mField);
}
foreach ($mField as $sField) {
$sField = strtolower($sField);
$key = array_search($sField, $this->_resultFields);
if ($key !== false) {
unset($this->_resultFields[$key]);
}
}
}