Dieser Commit ist enthalten in:
o.pinke 2021-06-11 08:34:24 +02:00
Ursprung 8278e52a89
Commit 603ce348eb
1 geänderte Dateien mit 23 neuen und 11 gelöschten Zeilen

Datei anzeigen

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