/** * Helper function for {@see MetaModelItem::parseValue()} and {@see MetaModelItem::parseAttribute()}. * * @param IMetaModelAttribute $objAttribute The attribute to parse. * * @param string $strOutputFormat The desired output format. * * @param IMetaModelRenderSettings $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; } // TODO: Add parseValue HOOK? } // If "hideEmptyValues" is true and the raw is empty remove text and output format. if (!is_null($objSettings) && $objSettings->get('hideEmptyValues') == true && $this->isEmptyValue($arrResult['raw']) == true) { unset($arrResult[$strOutputFormat]); unset($arrResult['text']); } return $arrResult; }