本文整理匯總了PHP中eZINI::variableArray方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZINI::variableArray方法的具體用法?PHP eZINI::variableArray怎麽用?PHP eZINI::variableArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eZINI
的用法示例。
在下文中一共展示了eZINI::variableArray方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: processObject
/**
* Processes Open Graph metadata from object attributes
*
* @param eZContentObject $contentObject
* @param array $returnArray
*
* @return array
*/
function processObject($contentObject, $returnArray)
{
if ($this->ogIni->hasVariable($contentObject->contentClassIdentifier(), 'LiteralMap')) {
$literalValues = $this->ogIni->variable($contentObject->contentClassIdentifier(), 'LiteralMap');
if ($this->debug) {
eZDebug::writeDebug($literalValues, 'LiteralMap');
}
if ($literalValues) {
foreach ($literalValues as $key => $value) {
if (!empty($value)) {
$returnArray[$key] = $value;
}
}
}
}
if ($this->ogIni->hasVariable($contentObject->contentClassIdentifier(), 'AttributeMap')) {
$attributeValues = $this->ogIni->variableArray($contentObject->contentClassIdentifier(), 'AttributeMap');
if ($this->debug) {
eZDebug::writeDebug($attributeValues, 'AttributeMap');
}
if ($attributeValues) {
foreach ($attributeValues as $key => $value) {
$contentObjectAttributeArray = $contentObject->fetchAttributesByIdentifier(array($value[0]));
if (!is_array($contentObjectAttributeArray)) {
continue;
}
$contentObjectAttributeArray = array_values($contentObjectAttributeArray);
$contentObjectAttribute = $contentObjectAttributeArray[0];
if ($contentObjectAttribute instanceof eZContentObjectAttribute) {
$openGraphHandler = ngOpenGraphBase::getInstance($contentObjectAttribute);
if (count($value) == 1) {
$data = $openGraphHandler->getData();
} else {
if (count($value) == 2) {
$data = $openGraphHandler->getDataMember($value[1]);
} else {
$data = "";
}
}
if (!empty($data)) {
$returnArray[$key] = $data;
}
}
}
}
}
return $returnArray;
}