当前位置: 首页>>代码示例>>PHP>>正文


PHP Handler::loadAllGroups方法代码示例

本文整理汇总了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;
 }
开发者ID:Jenkosama,项目名称:ezpublish-kernel,代码行数:32,代码来源:FieldNameResolver.php

示例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;
 }
开发者ID:CG77,项目名称:ezpublish-kernel,代码行数:37,代码来源:FieldMap.php

示例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;
 }
开发者ID:dfritschy,项目名称:ezpublish-kernel,代码行数:14,代码来源:ContentTypeService.php

示例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;
 }
开发者ID:dfritschy,项目名称:ezpublish-kernel,代码行数:42,代码来源:FieldMap.php

示例5: loadAllGroups

 /**
  * @return Group[]
  */
 public function loadAllGroups()
 {
     return $this->innerHandler->loadAllGroups();
 }
开发者ID:CG77,项目名称:ezpublish-kernel,代码行数:7,代码来源:MemoryCachingHandler.php


注:本文中的eZ\Publish\SPI\Persistence\Content\Type\Handler::loadAllGroups方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。