本文整理汇总了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();
}
示例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));
}
示例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)));
}
示例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));
}
示例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();
}