本文整理匯總了PHP中eZContentClass::setAttributes方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZContentClass::setAttributes方法的具體用法?PHP eZContentClass::setAttributes怎麽用?PHP eZContentClass::setAttributes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eZContentClass
的用法示例。
在下文中一共展示了eZContentClass::setAttributes方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: initClassMap
protected function initClassMap()
{
$definition = $this->attribute('definition');
if (!isset($definition['LocalClassIdentifier'])) {
throw new Exception("Configurazione LocalClassIdentifier non trovata");
}
if (!isset($definition['MapRemoteLocalAttributes'])) {
throw new Exception("Configurazione MapRemoteLocalAttributes non trovata");
}
$this->mapClassIdentifier = $definition['LocalClassIdentifier'];
$this->mapAttributes = $definition['MapRemoteLocalAttributes'];
$this->remoteClassAttributes = array_keys($this->mapAttributes);
$this->localeClassAttributes = array_values($this->mapAttributes);
$contentClassDataMap = array();
foreach ($this->remoteClassAttributes as $identifier) {
$contentClassAttribute = new OCClassSearchTemplate();
$contentClassAttribute->setAttributes(array('id' => $this->mapClassIdentifier . '-' . $identifier, 'identifier' => $identifier, 'name' => $identifier, 'is_searchable' => true, 'contentclass_id' => $this->classIdentifier));
$contentClassDataMap[$identifier] = $contentClassAttribute;
}
$this->contentClass = new OCClassSearchTemplate();
$this->contentClass->setAttributes(array('identifier' => $this->mapClassIdentifier, 'data_map' => $contentClassDataMap));
}