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


PHP Handler::getSearchableFieldMap方法代码示例

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


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

示例1: getSearchableFieldMap

 /**
  * @see \eZ\Publish\SPI\Persistence\Content\Type\Handler::getSearchableFieldMap
  */
 public function getSearchableFieldMap()
 {
     if ($this->searchableFieldMap !== null) {
         return $this->searchableFieldMap;
     }
     return $this->searchableFieldMap = $this->innerHandler->getSearchableFieldMap();
 }
开发者ID:Pixy,项目名称:ezpublish-kernel,代码行数:10,代码来源:MemoryCachingHandler.php

示例2: getTargetFieldNames

 /**
  * Resolves the targeted fields for this criterion.
  *
  * @param \eZ\Publish\API\Repository\Values\Content\Query\Criterion $criterion
  *
  * @return array
  */
 protected function getTargetFieldNames(Criterion $criterion)
 {
     if ($criterion->target != null) {
         return $this->fieldNameResolver->getFieldNames($criterion, $criterion->target, $this->fieldTypeIdentifier, $this->fieldName);
     }
     $targetFieldNames = array();
     foreach ($this->contentTypeHandler->getSearchableFieldMap() as $fieldDefinitions) {
         foreach ($fieldDefinitions as $fieldIdentifier => $fieldDefinition) {
             if (!isset($fieldDefinition['field_type_identifier'])) {
                 continue;
             }
             if ($fieldDefinition['field_type_identifier'] != $this->fieldTypeIdentifier) {
                 continue;
             }
             $solrFieldNames = $this->fieldNameResolver->getFieldNames($criterion, $fieldIdentifier, $this->fieldTypeIdentifier, $this->fieldName);
             $targetFieldNames = array_merge($targetFieldNames, $solrFieldNames);
         }
     }
     return array_values(array_unique($targetFieldNames));
 }
开发者ID:netgen,项目名称:tagsbundle,代码行数:27,代码来源:Tags.php

示例3: applyJoin

 /**
  * Applies joins to the query, required to fetch sort data.
  *
  * @param \eZ\Publish\Core\Persistence\Database\SelectQuery $query
  * @param \eZ\Publish\API\Repository\Values\Content\Query\SortClause $sortClause
  * @param int $number
  * @param array $languageSettings
  */
 public function applyJoin(SelectQuery $query, SortClause $sortClause, $number, array $languageSettings)
 {
     /** @var \eZ\Publish\API\Repository\Values\Content\Query\SortClause\Target\FieldTarget $fieldTarget */
     $fieldTarget = $sortClause->targetData;
     $fieldMap = $this->contentTypeHandler->getSearchableFieldMap();
     if (!isset($fieldMap[$fieldTarget->typeIdentifier][$fieldTarget->fieldIdentifier]['field_definition_id'])) {
         throw new InvalidArgumentException('$sortClause->targetData', 'No searchable fields found for the given sort clause target ' . "'{$fieldTarget->fieldIdentifier}' on '{$fieldTarget->typeIdentifier}'.");
     }
     $fieldDefinitionId = $fieldMap[$fieldTarget->typeIdentifier][$fieldTarget->fieldIdentifier]['field_definition_id'];
     $table = $this->getSortTableName($number);
     $query->leftJoin($query->alias($this->dbHandler->quoteTable('ezcontentobject_attribute'), $this->dbHandler->quoteIdentifier($table)), $query->expr->lAnd($query->expr->eq($query->bindValue($fieldDefinitionId, null, PDO::PARAM_INT), $this->dbHandler->quoteColumn('contentclassattribute_id', $table)), $query->expr->eq($this->dbHandler->quoteColumn('contentobject_id', $table), $this->dbHandler->quoteColumn('id', 'ezcontentobject')), $query->expr->eq($this->dbHandler->quoteColumn('version', $table), $this->dbHandler->quoteColumn('current_version', 'ezcontentobject')), $this->getFieldCondition($query, $languageSettings, $table)));
 }
开发者ID:ezsystems,项目名称:ezpublish-kernel,代码行数:20,代码来源:Field.php

示例4: applyJoin

 /**
  * Applies joins to the query, required to fetch sort data
  *
  * @param \eZ\Publish\Core\Persistence\Database\SelectQuery $query
  * @param \eZ\Publish\API\Repository\Values\Content\Query\SortClause $sortClause
  * @param int $number
  *
  * @return void
  */
 public function applyJoin(SelectQuery $query, SortClause $sortClause, $number)
 {
     /** @var \eZ\Publish\API\Repository\Values\Content\Query\SortClause\Target\FieldTarget $fieldTarget */
     $fieldTarget = $sortClause->targetData;
     $fieldMap = $this->contentTypeHandler->getSearchableFieldMap();
     if (!isset($fieldMap[$fieldTarget->typeIdentifier][$fieldTarget->fieldIdentifier]["field_definition_id"])) {
         throw new InvalidArgumentException("\$sortClause->targetData", "No searchable fields found for the given sort clause target " . "'{$fieldTarget->fieldIdentifier}' on '{$fieldTarget->typeIdentifier}'.");
     }
     $fieldDefinitionId = $fieldMap[$fieldTarget->typeIdentifier][$fieldTarget->fieldIdentifier]["field_definition_id"];
     $table = $this->getSortTableName($number);
     if ($fieldTarget->languageCode === null) {
         $languageExpression = $query->expr->gt($query->expr->bitAnd($query->expr->bitAnd($this->dbHandler->quoteColumn("language_id", $table), ~1), $this->dbHandler->quoteColumn("initial_language_id", "ezcontentobject")), 0);
     } else {
         $languageExpression = $query->expr->gt($query->expr->bitAnd($query->expr->bitAnd($this->dbHandler->quoteColumn("language_id", $table), ~1), $query->bindValue($this->languageHandler->loadByLanguageCode($fieldTarget->languageCode)->id, null, \PDO::PARAM_INT)), 0);
     }
     $query->leftJoin($query->alias($this->dbHandler->quoteTable("ezcontentobject_attribute"), $this->dbHandler->quoteIdentifier($table)), $query->expr->lAnd($query->expr->eq($query->bindValue($fieldDefinitionId, null, PDO::PARAM_INT), $this->dbHandler->quoteColumn("contentclassattribute_id", $table)), $query->expr->eq($this->dbHandler->quoteColumn("contentobject_id", $table), $this->dbHandler->quoteColumn("id", "ezcontentobject")), $query->expr->eq($this->dbHandler->quoteColumn("version", $table), $this->dbHandler->quoteColumn("current_version", "ezcontentobject")), $languageExpression));
 }
开发者ID:nlescure,项目名称:ezpublish-kernel,代码行数:26,代码来源:Field.php

示例5: getSearchableFieldMap

 /**
  * Get content type, field definition and field type mapping information
  *
  * Returns an array in the form:
  *
  * <code>
  *  array(
  *      "<ContentType identifier>" => array(
  *          "<FieldDefinition identifier>" => array(
  *              "field_definition_id" => "<FieldDefinition id>",
  *              "field_type_identifier" => "<FieldType identifier>",
  *          ),
  *          ...
  *      ),
  *      ...
  *  )
  * </code>
  *
  * @return array
  */
 protected function getSearchableFieldMap()
 {
     return $this->contentTypeHandler->getSearchableFieldMap();
 }
开发者ID:ezsystemstraining,项目名称:ez54training,代码行数:24,代码来源:FieldNameResolver.php


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