本文整理汇总了PHP中eZ\Publish\SPI\Persistence\Content\Type\Handler::loadAllGroups方法的典型用法代码示例。如果您正苦于以下问题:PHP Handler::loadAllGroups方法的具体用法?PHP Handler::loadAllGroups怎么用?PHP Handler::loadAllGroups使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZ\Publish\SPI\Persistence\Content\Type\Handler
的用法示例。
在下文中一共展示了Handler::loadAllGroups方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFieldMap
/**
* Get field type information
*
* Returns an array in the form:
*
* <code>
* array(
* "content-type-identifier" => array(
* "field-definition-identifier" => "field-type-identifier",
* …
* ),
* …
* )
* </code>
*
* @return array
*/
protected function getFieldMap()
{
$fieldTypes = [];
foreach ($this->contentTypeHandler->loadAllGroups() as $group) {
foreach ($this->contentTypeHandler->loadContentTypes($group->id) as $contentType) {
foreach ($contentType->fieldDefinitions as $fieldDefinition) {
if (!$fieldDefinition->isSearchable) {
continue;
}
$fieldTypes[$contentType->identifier][$fieldDefinition->identifier] = $fieldDefinition->fieldType;
}
}
}
return $fieldTypes;
}
示例2: getSortFieldTypes
/**
* Get field type information for sort clause
*
* TODO: handle custom field
* TODO: caching (see above)
*
* @param string $contentTypeIdentifier
* @param string $fieldDefinitionIdentifier
* @param string $languageCode
*
* @return array
*/
public function getSortFieldTypes($contentTypeIdentifier, $fieldDefinitionIdentifier, $languageCode)
{
$types = array();
foreach ($this->contentTypeHandler->loadAllGroups() as $group) {
foreach ($this->contentTypeHandler->loadContentTypes($group->id) as $contentType) {
if ($contentType->identifier !== $contentTypeIdentifier) {
continue;
}
foreach ($contentType->fieldDefinitions as $fieldDefinition) {
if ($fieldDefinition->identifier !== $fieldDefinitionIdentifier) {
continue;
}
// TODO: find a better way to handle non-translatable fields?
if ($languageCode === null || $fieldDefinition->isTranslatable) {
$fieldType = $this->fieldRegistry->getType($fieldDefinition->fieldType);
foreach ($fieldType->getIndexDefinition() as $name => $type) {
$types[$type->type] = $this->nameGenerator->getTypedName($this->nameGenerator->getName($name, $fieldDefinition->identifier, $contentType->identifier), $type);
}
}
break 3;
}
}
}
return $types;
}
示例3: loadContentTypeGroups
/**
* Get all Content Type Groups
*
* @return \eZ\Publish\Core\Repository\Values\ContentType\ContentTypeGroup[]
*/
public function loadContentTypeGroups()
{
$spiGroups = $this->contentTypeHandler->loadAllGroups();
$groups = array();
foreach ($spiGroups as $spiGroup) {
$groups[] = $this->buildContentTypeGroupDomainObject($spiGroup);
}
return $groups;
}
示例4: getFieldTypes
/**
* Get field type information
*
* Returns an array in the form:
*
* <code>
* array(
* "field-identifier" => array(
* "solr_field_name",
* …
* ),
* …
* )
* </code>
*
* @param \eZ\Publish\API\Repository\Values\Content\Query\CustomFieldInterface $criterion
*
* @return array
*/
public function getFieldTypes(CustomFieldInterface $criterion)
{
// @TODO: temp fixed by disabling caching, see https://jira.ez.no/browse/EZP-22834
$this->fieldTypes = array();
foreach ($this->contentTypeHandler->loadAllGroups() as $group) {
foreach ($this->contentTypeHandler->loadContentTypes($group->id) as $contentType) {
foreach ($contentType->fieldDefinitions as $fieldDefinition) {
if (!$fieldDefinition->isSearchable) {
continue;
}
if ($customField = $criterion->getCustomField($contentType->identifier, $fieldDefinition->identifier)) {
$this->fieldTypes[$fieldDefinition->identifier]["custom"][] = $customField;
continue;
}
$fieldType = $this->fieldRegistry->getType($fieldDefinition->fieldType);
foreach ($fieldType->getIndexDefinition() as $name => $type) {
$this->fieldTypes[$fieldDefinition->identifier][$type->type][] = $this->nameGenerator->getTypedName($this->nameGenerator->getName($name, $fieldDefinition->identifier, $contentType->identifier), $type);
}
}
}
}
return $this->fieldTypes;
}
示例5: loadAllGroups
/**
* @return Group[]
*/
public function loadAllGroups()
{
return $this->innerHandler->loadAllGroups();
}