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


PHP Handler::loadContentTypes方法代码示例

本文整理汇总了PHP中eZ\Publish\SPI\Persistence\Content\Type\Handler::loadContentTypes方法的典型用法代码示例。如果您正苦于以下问题:PHP Handler::loadContentTypes方法的具体用法?PHP Handler::loadContentTypes怎么用?PHP Handler::loadContentTypes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eZ\Publish\SPI\Persistence\Content\Type\Handler的用法示例。


在下文中一共展示了Handler::loadContentTypes方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: loadContentTypes

 /**
  * Get Content Type objects which belong to the given content type group
  *
  * @param \eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroup $contentTypeGroup
  *
  * @return \eZ\Publish\API\Repository\Values\ContentType\ContentType[] Which have status DEFINED
  */
 public function loadContentTypes(APIContentTypeGroup $contentTypeGroup)
 {
     $spiContentTypes = $this->contentTypeHandler->loadContentTypes($contentTypeGroup->id, SPIContentType::STATUS_DEFINED);
     $contentTypes = array();
     foreach ($spiContentTypes as $spiContentType) {
         $contentTypes[] = $this->buildContentTypeDomainObject($spiContentType);
     }
     return $contentTypes;
 }
开发者ID:dfritschy,项目名称:ezpublish-kernel,代码行数:16,代码来源:ContentTypeService.php

示例4: loadContentTypes

 /**
  * Get Content Type objects which belong to the given content type group.
  *
  * @param \eZ\Publish\API\Repository\Values\ContentType\ContentTypeGroup $contentTypeGroup
  *
  * @return \eZ\Publish\API\Repository\Values\ContentType\ContentType[] Which have status DEFINED
  */
 public function loadContentTypes(APIContentTypeGroup $contentTypeGroup)
 {
     $spiContentTypes = $this->contentTypeHandler->loadContentTypes($contentTypeGroup->id, SPIContentType::STATUS_DEFINED);
     $contentTypes = array();
     foreach ($spiContentTypes as $spiContentType) {
         $contentTypes[] = $this->contentTypeDomainMapper->buildContentTypeDomainObject($spiContentType, array_map(function ($id) {
             return $this->contentTypeHandler->loadGroup($id);
         }, $spiContentType->groupIds));
     }
     return $contentTypes;
 }
开发者ID:emodric,项目名称:ezpublish-kernel,代码行数:18,代码来源:ContentTypeService.php

示例5: 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

示例6: loadContentTypes

 /**
  * @param mixed $groupId
  * @param int $status
  * @return Type[]
  */
 public function loadContentTypes($groupId, $status = 0)
 {
     return $this->innerHandler->loadContentTypes($groupId, $status);
 }
开发者ID:CG77,项目名称:ezpublish-kernel,代码行数:9,代码来源:MemoryCachingHandler.php


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