public function SolrFieldType::getCollatedFieldTypeAsJson in Search API Solr 4.x
Same name and namespace in other branches
- 8.3 src/Entity/SolrFieldType.php \Drupal\search_api_solr\Entity\SolrFieldType::getCollatedFieldTypeAsJson()
Gets the Solr Collated Field Type definition as JSON.
The JSON format is used to interact with a managed Solr schema.
Parameters
bool $pretty: Return pretty printed JSON.
Return value
string The Solr Spellcheck Field Type definition as JSON.
Overrides SolrFieldTypeInterface::getCollatedFieldTypeAsJson
File
- src/
Entity/ SolrFieldType.php, line 316
Class
- SolrFieldType
- Defines the SolrFieldType entity.
Namespace
Drupal\search_api_solr\EntityCode
public function getCollatedFieldTypeAsJson(bool $pretty = FALSE) {
if ($this->collated_field_type) {
/** @noinspection PhpComposerExtensionStubsInspection */
return $pretty ? json_encode($this->collated_field_type, JSON_PRETTY_PRINT | JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT) : Json::encode($this->collated_field_type);
}
return '';
}