/**
* Helper function for {@see MetaModelItem::parseValue()} and {@see MetaModelItem::parseAttribute()}.
*
* @param IAttribute $objAttribute The attribute to parse.
*
* @param string $strOutputFormat The desired output format.
*
* @param ICollection|null $objSettings The settings object to be applied.
*
* @return array The parsed information for the given attribute.
*/
public function internalParseAttribute($objAttribute, $strOutputFormat, $objSettings)
{
$arrResult = array();
if ($objAttribute) {
// Extract view settings for this attribute.
if ($objSettings) {
$objAttributeSettings = $objSettings->getSetting($objAttribute->getColName());
} else {
$objAttributeSettings = null;
}
foreach ($objAttribute->parseValue($this->arrData, $strOutputFormat, $objAttributeSettings) as $strKey => $varValue) {
$arrResult[$strKey] = $varValue;
}
}
// If "hideEmptyValues" is true and the raw is empty remove text and output format.
if ($objSettings instanceof ICollection && $objSettings->get('hideEmptyValues') && $this->isEmptyValue($arrResult['raw'])) {
unset($arrResult[$strOutputFormat]);
unset($arrResult['text']);
}
return $arrResult;
}