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


PHP Content::getFieldsByLanguage方法代码示例

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


在下文中一共展示了Content::getFieldsByLanguage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: mapContent

 /**
  * Maps Repository Content to the Site Content.
  *
  * @param \eZ\Publish\API\Repository\Values\Content\Content $content
  * @param string $languageCode
  *
  * @return \Netgen\EzPlatformSiteApi\Core\Site\Values\Content
  */
 public function mapContent(APIContent $content, $languageCode)
 {
     $contentType = $this->contentTypeService->loadContentType($content->contentInfo->contentTypeId);
     $fields = $content->getFieldsByLanguage($languageCode);
     $fieldsData = [];
     foreach ($fields as $field) {
         $fieldsData[] = $this->mapFieldData($field, $contentType);
     }
     return new Content(['_fields_data' => $fieldsData, 'contentInfo' => $this->mapContentInfo($content->versionInfo, $languageCode, $contentType), 'innerContent' => $content]);
 }
开发者ID:netgen,项目名称:ezplatform-site-api,代码行数:18,代码来源:DomainObjectMapper.php

示例2: ezobjectrelation

 /**
  * Method for parsing ezobjectrelation field.
  * For now related fields refer to images.
  *
  * @param \eZ\Publish\API\Repository\Values\Content\Field $field
  * @param \eZ\Publish\API\Repository\Values\Content\Content $content
  * @param string $language
  * @param string $imageFieldIdentifier
  *
  * @return string
  */
 public function ezobjectrelation(Field $field, Content $content, $language, $imageFieldIdentifier)
 {
     $fields = $content->getFieldsByLanguage($language);
     foreach ($fields as $type => $field) {
         if ($type == $imageFieldIdentifier) {
             return $this->ezimage($field, $content);
         }
     }
     return '';
 }
开发者ID:sdaoudi,项目名称:EzSystemsRecommendationBundle,代码行数:21,代码来源:TypeValue.php

示例3: getFieldsByLanguage

 /**
  * This method returns the fields for a given language and non translatable fields
  *
  * If note set the initialLanguage of the content version is used.
  *
  * @param string $languageCode
  *
  * @return \eZ\Publish\API\Repository\Values\Content\Field[] With field identifier as keys
  */
 public function getFieldsByLanguage($languageCode = null)
 {
     return $this->content->getFieldsByLanguage($languageCode);
 }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:13,代码来源:UserStub.php

示例4: getFirstFilledImageFieldIdentifier

 public function getFirstFilledImageFieldIdentifier(Content $content)
 {
     foreach ($content->getFieldsByLanguage() as $field) {
         $fieldTypeIdentifier = $this->fieldHelper->getFieldDefinition($content->contentInfo, $field->fieldDefIdentifier)->fieldTypeIdentifier;
         if ($fieldTypeIdentifier !== 'ezimage') {
             continue;
         }
         if ($this->fieldHelper->isFieldEmpty($content, $field->fieldDefIdentifier)) {
             continue;
         }
         return $field->fieldDefIdentifier;
     }
     return null;
 }
开发者ID:emodric,项目名称:ezpublish-kernel,代码行数:14,代码来源:ContentExtension.php


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