Complex classes like TypoScriptConfiguration often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use TypoScriptConfiguration, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 35 | class TypoScriptConfiguration |
||
| 36 | { |
||
| 37 | /** |
||
| 38 | * @var \ApacheSolrForTypo3\Solr\System\Util\ArrayAccessor|null |
||
| 39 | */ |
||
| 40 | protected $configurationAccess = null; |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Holds the pageId in which context the configuration was parsed |
||
| 44 | * (normally $GLOBALS['TSFE']->id) |
||
| 45 | */ |
||
| 46 | protected $contextPageId = 0; |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @param array $configuration |
||
| 50 | * @param int $contextPageId |
||
| 51 | */ |
||
| 52 | 194 | public function __construct(array $configuration, $contextPageId = 0) |
|
| 57 | |||
| 58 | /** |
||
| 59 | * Checks if a value is 1, '1', 'true' |
||
| 60 | * @param mixed $value |
||
| 61 | * @return bool |
||
| 62 | */ |
||
| 63 | 177 | protected function getBool($value) |
|
| 67 | |||
| 68 | /** |
||
| 69 | * This method can be used to only retrieve array keys where the value is not an array. |
||
| 70 | * |
||
| 71 | * This can be very handy in the configuration when only keys should ne taken into account |
||
| 72 | * where the value is not a subconfiguration (typically an typoscript object path). |
||
| 73 | * |
||
| 74 | * @param $inputArray |
||
| 75 | * @return array |
||
| 76 | */ |
||
| 77 | 7 | protected function getOnlyArrayKeysWhereValueIsNotAnArray($inputArray) |
|
| 78 | { |
||
| 79 | 7 | $keysWithNonArrayValue = array(); |
|
| 80 | |||
| 81 | 7 | foreach ($inputArray as $key => $value) { |
|
| 82 | 7 | if (is_array($value)) { |
|
| 83 | // configuration for a content object, skipping |
||
| 84 | 6 | continue; |
|
| 85 | } |
||
| 86 | |||
| 87 | 7 | $keysWithNonArrayValue[] = $key; |
|
| 88 | } |
||
| 89 | |||
| 90 | 7 | return $keysWithNonArrayValue; |
|
| 91 | } |
||
| 92 | |||
| 93 | /** |
||
| 94 | * Gets the value from a given TypoScript path. |
||
| 95 | * |
||
| 96 | * In the context of an frontend content element the path plugin.tx_solr is |
||
| 97 | * merged recursive with overrule with the content element specific typoscript |
||
| 98 | * settings, like plugin.tx_solr_PiResults_Results, and possible flex form settings |
||
| 99 | * (depends on the solr plugin). |
||
| 100 | * |
||
| 101 | * Example: plugin.tx_solr.search.targetPage |
||
| 102 | * returns $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_solr.']['search.']['targetPage'] |
||
| 103 | * |
||
| 104 | * @param string $path TypoScript path |
||
| 105 | * @return array The TypoScript object defined by the given path |
||
| 106 | * @throws InvalidArgumentException |
||
| 107 | */ |
||
| 108 | 213 | public function getValueByPath($path) |
|
| 117 | |||
| 118 | /** |
||
| 119 | * This method can be used to get a configuration value by path if it exists or return a |
||
| 120 | * default value when it does not exist. |
||
| 121 | * |
||
| 122 | * @param string $path |
||
| 123 | * @param mixed $defaultValue |
||
| 124 | * @return mixed |
||
| 125 | */ |
||
| 126 | 212 | public function getValueByPathOrDefaultValue($path, $defaultValue) |
|
| 135 | |||
| 136 | /** |
||
| 137 | * Gets the parent TypoScript Object from a given TypoScript path. |
||
| 138 | * |
||
| 139 | * In the context of an frontend content element the path plugin.tx_solr is |
||
| 140 | * merged recursive with overrule with the content element specific typoscript |
||
| 141 | * settings, like plugin.tx_solr_PiResults_Results, and possible flex form settings |
||
| 142 | * (depends on the solr plugin). |
||
| 143 | * |
||
| 144 | * Example: plugin.tx_solr.index.queue.tt_news.fields.content |
||
| 145 | * returns $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_solr.']['index.']['queue.']['tt_news.']['fields.']['content.'] |
||
| 146 | * which is a SOLR_CONTENT cObj. |
||
| 147 | * |
||
| 148 | * @param string $path TypoScript path |
||
| 149 | * @return array The TypoScript object defined by the given path |
||
| 150 | * @throws InvalidArgumentException |
||
| 151 | */ |
||
| 152 | 100 | public function getObjectByPath($path) |
|
| 153 | { |
||
| 154 | 100 | if (substr($path, -1) !== '.') { |
|
| 155 | 4 | $path = rtrim($path, '.'); |
|
| 156 | 4 | $path = substr($path, 0, strrpos($path, '.') + 1); |
|
| 157 | } |
||
| 158 | |||
| 159 | 100 | if (!is_string($path)) { |
|
| 160 | throw new InvalidArgumentException('Parameter $path is not a string', 1325627243); |
||
| 161 | } |
||
| 162 | |||
| 163 | 100 | return $this->configurationAccess->get($path); |
|
| 164 | } |
||
| 165 | |||
| 166 | /** |
||
| 167 | * Gets the parent TypoScript Object from a given TypoScript path and if not present return |
||
| 168 | * the default value |
||
| 169 | * |
||
| 170 | * @see getObjectByPath |
||
| 171 | * @param string $path |
||
| 172 | * @param array $defaultValue |
||
| 173 | * @return array |
||
| 174 | */ |
||
| 175 | 96 | public function getObjectByPathOrDefault($path, array $defaultValue) |
|
| 176 | { |
||
| 177 | try { |
||
| 178 | 96 | $object = $this->getObjectByPath($path); |
|
| 179 | } catch (\InvalidArgumentException $e) { |
||
| 180 | return $defaultValue; |
||
| 181 | } |
||
| 182 | |||
| 183 | 96 | if (!is_array($object)) { |
|
| 184 | 41 | return $defaultValue; |
|
| 185 | } |
||
| 186 | |||
| 187 | 85 | return $object; |
|
| 188 | } |
||
| 189 | |||
| 190 | /** |
||
| 191 | * Checks whether a given TypoScript path is valid. |
||
| 192 | * |
||
| 193 | * @param string $path TypoScript path |
||
| 194 | * @return bool TRUE if the path resolves, FALSE otherwise |
||
| 195 | */ |
||
| 196 | public function isValidPath($path) |
||
| 197 | { |
||
| 198 | $isValidPath = false; |
||
| 199 | |||
| 200 | $pathValue = $this->getValueByPath($path); |
||
| 201 | if (!is_null($pathValue)) { |
||
| 202 | $isValidPath = true; |
||
| 203 | } |
||
| 204 | |||
| 205 | return $isValidPath; |
||
| 206 | } |
||
| 207 | |||
| 208 | /** |
||
| 209 | * Merges a configuration with another configuration a |
||
| 210 | * |
||
| 211 | * @param array $configurationToMerge |
||
| 212 | * @param bool $addKeys If set to FALSE, keys that are NOT found in $original will not be set. Thus only existing value can/will be overruled from overrule array. |
||
| 213 | * @param bool $includeEmptyValues If set, values from $overrule will overrule if they are empty or zero. |
||
| 214 | * @param bool $enableUnsetFeature If set, special values "__UNSET" can be used in the overrule array in order to unset array keys in the original array. |
||
| 215 | * @return TypoScriptConfiguration |
||
| 216 | */ |
||
| 217 | 27 | public function mergeSolrConfiguration(array $configurationToMerge, $addKeys = true, $includeEmptyValues = true, $enableUnsetFeature = true) |
|
| 218 | { |
||
| 219 | 27 | $data = $this->configurationAccess->getData(); |
|
| 220 | 27 | ArrayUtility::mergeRecursiveWithOverrule( |
|
| 221 | 27 | $data['plugin.']['tx_solr.'], |
|
| 222 | $configurationToMerge, |
||
| 223 | $addKeys, |
||
| 224 | $includeEmptyValues, |
||
| 225 | $enableUnsetFeature |
||
| 226 | ); |
||
| 227 | |||
| 228 | 27 | $this->configurationAccess->setData($data); |
|
| 229 | |||
| 230 | 27 | return $this; |
|
| 231 | } |
||
| 232 | |||
| 233 | /** |
||
| 234 | * Returns the configured css file for a specific fileKey. |
||
| 235 | * |
||
| 236 | * plugin.tx_solr.cssFiles.<fileKey> |
||
| 237 | * |
||
| 238 | * @param string $fileKey |
||
| 239 | * @param string $defaultIfEmpty |
||
| 240 | * @return string |
||
| 241 | */ |
||
| 242 | 25 | public function getCssFileByFileKey($fileKey, $defaultIfEmpty = '') |
|
| 247 | |||
| 248 | /** |
||
| 249 | * Returns the configured additionalFields configured for the indexing. |
||
| 250 | * |
||
| 251 | * plugin.tx_solr.index.additionalFields. |
||
| 252 | * |
||
| 253 | * @param array $defaultIfEmpty |
||
| 254 | * @return array |
||
| 255 | */ |
||
| 256 | 3 | public function getIndexAdditionalFieldsConfiguration($defaultIfEmpty = array()) |
|
| 261 | |||
| 262 | /** |
||
| 263 | * Returns all solr fields names where a mapping is configured in index.additionalFields |
||
| 264 | * |
||
| 265 | * Returns all keys from |
||
| 266 | * plugin.tx_solr.index.additionalFields. |
||
| 267 | * |
||
| 268 | * @param array $defaultIfEmpty |
||
| 269 | * @return array |
||
| 270 | */ |
||
| 271 | 2 | public function getIndexMappedAdditionalFieldNames($defaultIfEmpty = array()) |
|
| 277 | |||
| 278 | /** |
||
| 279 | * Returns the fieldProcessingInstructions configuration array |
||
| 280 | * |
||
| 281 | * plugin.tx_solr.index.fieldProcessingInstructions. |
||
| 282 | * |
||
| 283 | * @param array $defaultIfEmpty |
||
| 284 | * @return array |
||
| 285 | */ |
||
| 286 | 45 | public function getIndexFieldProcessingInstructionsConfiguration(array $defaultIfEmpty = array()) |
|
| 291 | |||
| 292 | /** |
||
| 293 | * Retrieves the indexing configuration array for an indexing queue by configuration name. |
||
| 294 | * |
||
| 295 | * plugin.tx_solr.index.queue.<configurationName>. |
||
| 296 | * |
||
| 297 | * @param string $configurationName |
||
| 298 | * @param array $defaultIfEmpty |
||
| 299 | * @return array |
||
| 300 | */ |
||
| 301 | 5 | public function getIndexQueueConfigurationByName($configurationName, array $defaultIfEmpty = array()) |
|
| 307 | |||
| 308 | /** |
||
| 309 | * Returns an array of all allowedPageTypes. |
||
| 310 | * |
||
| 311 | * plugin.tx_solr.index.queue.pages.allowedPageTypes |
||
| 312 | * |
||
| 313 | * @param string $configurationName The configuration name of the queue to use. |
||
| 314 | * @param array $defaultIfEmpty |
||
| 315 | * @return array |
||
| 316 | */ |
||
| 317 | 16 | public function getIndexQueueAllowedPageTypesArrayByConfigurationName($configurationName = 'pages', $defaultIfEmpty = []) |
|
| 327 | |||
| 328 | /** |
||
| 329 | * Returns an array of all allowedPageTypes. |
||
| 330 | * |
||
| 331 | * plugin.tx_solr.index.queue.pages.allowedPageTypes |
||
| 332 | * |
||
| 333 | * @deprecated since 6.0 will be removed in 7.0 |
||
| 334 | * |
||
| 335 | * @param array $defaultIfEmpty |
||
| 336 | * @return array |
||
| 337 | */ |
||
| 338 | 1 | public function getIndexQueuePagesAllowedPageTypesArray($defaultIfEmpty = array()) |
|
| 339 | { |
||
| 340 | 1 | return $this->getIndexQueueAllowedPageTypesArrayByConfigurationName( |
|
| 341 | 1 | 'pages', |
|
| 342 | $defaultIfEmpty |
||
| 343 | ); |
||
| 344 | } |
||
| 345 | |||
| 346 | /** |
||
| 347 | * Returns the configured excludeContentByClass patterns as array. |
||
| 348 | * |
||
| 349 | * plugin.tx_solr.index.queue.pages.excludeContentByClass |
||
| 350 | * |
||
| 351 | * @param array $defaultIfEmpty |
||
| 352 | * @return array |
||
| 353 | */ |
||
| 354 | 30 | public function getIndexQueuePagesExcludeContentByClassArray($defaultIfEmpty = array()) |
|
| 365 | |||
| 366 | /** |
||
| 367 | * Returns the configured database table for an indexing queue configuration or |
||
| 368 | * the configurationName itself that is used by convention as tableName when no |
||
| 369 | * other tablename is present. |
||
| 370 | * |
||
| 371 | * plugin.tx_solr.index.queue.<configurationName>.table or configurationName |
||
| 372 | * |
||
| 373 | * @param string $configurationName |
||
| 374 | * @return string |
||
| 375 | */ |
||
| 376 | 23 | public function getIndexQueueTableNameOrFallbackToConfigurationName($configurationName = '') |
|
| 382 | |||
| 383 | /** |
||
| 384 | * Returns the field configuration for a specific index queue. |
||
| 385 | * |
||
| 386 | * plugin.tx_solr.index.queue.<configurationName>.fields. |
||
| 387 | * |
||
| 388 | * @param string $configurationName |
||
| 389 | * @param array $defaultIfEmpty |
||
| 390 | * @return array |
||
| 391 | */ |
||
| 392 | 17 | public function getIndexQueueFieldsConfigurationByConfigurationName($configurationName = '', $defaultIfEmpty = array()) |
|
| 398 | |||
| 399 | /** |
||
| 400 | * Gets an array of tables configured for indexing by the Index Queue. Since the |
||
| 401 | * record monitor must watch these tables for manipulation. |
||
| 402 | * |
||
| 403 | * @return array Array of table names to be watched by the record monitor. |
||
| 404 | */ |
||
| 405 | 16 | public function getIndexQueueMonitoredTables() |
|
| 406 | { |
||
| 407 | 16 | $monitoredTables = []; |
|
| 408 | |||
| 409 | 16 | $indexingConfigurations = $this->getEnabledIndexQueueConfigurationNames(); |
|
| 410 | 16 | foreach ($indexingConfigurations as $indexingConfigurationName) { |
|
| 411 | 16 | $monitoredTable = $this->getIndexQueueTableNameOrFallbackToConfigurationName($indexingConfigurationName); |
|
| 412 | 16 | $monitoredTables[] = $monitoredTable; |
|
| 413 | 16 | if ($monitoredTable == 'pages') { |
|
| 414 | // when monitoring pages, also monitor creation of translations |
||
| 415 | 16 | $monitoredTables[] = 'pages_language_overlay'; |
|
| 416 | } |
||
| 417 | } |
||
| 418 | |||
| 419 | 16 | return array_values(array_unique($monitoredTables)); |
|
| 420 | } |
||
| 421 | |||
| 422 | /** |
||
| 423 | * This method can be used to check if a table is configured to be monitored by the record monitor. |
||
| 424 | * |
||
| 425 | * @param string $tableName |
||
| 426 | * @return bool |
||
| 427 | */ |
||
| 428 | 15 | public function getIndexQueueIsMonitoredTable($tableName) |
|
| 432 | |||
| 433 | /** |
||
| 434 | * Returns the configured indexer class that should be used for a certain indexingConfiguration. |
||
| 435 | * By default "ApacheSolrForTypo3\\Solr\\IndexQueue\\Indexer" will be returned. |
||
| 436 | * |
||
| 437 | * plugin.tx_solr.index.queue.<configurationName>.indexer |
||
| 438 | * |
||
| 439 | * @param string $configurationName |
||
| 440 | * @param string $defaultIfEmpty |
||
| 441 | * @return string |
||
| 442 | */ |
||
| 443 | 6 | public function getIndexQueueIndexerByConfigurationName($configurationName, $defaultIfEmpty = 'ApacheSolrForTypo3\\Solr\\IndexQueue\\Indexer') |
|
| 449 | |||
| 450 | /** |
||
| 451 | * Returns the configuration of an indexer for a special indexingConfiguration. By default an empty |
||
| 452 | * array is returned. |
||
| 453 | * |
||
| 454 | * plugin.tx_solr.index.queue.<configurationName>.indexer. |
||
| 455 | * |
||
| 456 | * @param string $configurationName |
||
| 457 | * @param array $defaultIfEmpty |
||
| 458 | * @return array |
||
| 459 | */ |
||
| 460 | 6 | public function getIndexQueueIndexerConfigurationByConfigurationName($configurationName, $defaultIfEmpty = array()) |
|
| 466 | |||
| 467 | /** |
||
| 468 | * Returns all solr fields names where a mapping configuration is set for a certain index configuration |
||
| 469 | * |
||
| 470 | * Returns all keys from |
||
| 471 | * plugin.tx_solr.index.queue.<configurationName>.fields. |
||
| 472 | * |
||
| 473 | * @param string $configurationName |
||
| 474 | * @param array $defaultIfEmpty |
||
| 475 | * @return array |
||
| 476 | */ |
||
| 477 | 6 | public function getIndexQueueMappedFieldsByConfigurationName($configurationName = '', $defaultIfEmpty = array()) |
|
| 483 | |||
| 484 | /** |
||
| 485 | * This method is used to check if an index queue configuration is enabled or not |
||
| 486 | * |
||
| 487 | * plugin.tx_solr.index.queue.<configurationName> = 1 |
||
| 488 | * |
||
| 489 | * @param string $configurationName |
||
| 490 | * @param bool $defaultIfEmpty |
||
| 491 | * @return bool |
||
| 492 | */ |
||
| 493 | 10 | public function getIndexQueueConfigurationIsEnabled($configurationName, $defaultIfEmpty = false) |
|
| 499 | |||
| 500 | /** |
||
| 501 | * Retrieves an array of enabled index queue configurations. |
||
| 502 | * |
||
| 503 | * plugin.tx_solr.index.queue.<configurationName> |
||
| 504 | * |
||
| 505 | * @param array $defaultIfEmpty |
||
| 506 | * @return array |
||
| 507 | */ |
||
| 508 | 18 | public function getEnabledIndexQueueConfigurationNames($defaultIfEmpty = array()) |
|
| 521 | |||
| 522 | /** |
||
| 523 | * Retrieves and initialPagesAdditionalWhereClause where clause when configured or an empty string. |
||
| 524 | * |
||
| 525 | * plugin.tx_solr.index.queue.pages.initialPagesAdditionalWhereClause |
||
| 526 | * |
||
| 527 | * @param string $defaultIfEmpty |
||
| 528 | * |
||
| 529 | * @return string |
||
| 530 | 29 | * |
|
| 531 | */ |
||
| 532 | 29 | public function getInitialPagesAdditionalWhereClause($defaultIfEmpty = ' AND 1=1') |
|
| 543 | |||
| 544 | /** |
||
| 545 | * Retrieves and additional where clause when configured or an empty string. |
||
| 546 | * |
||
| 547 | * plugin.tx_solr.index.queue.<configurationName>.additionalWhereClause |
||
| 548 | * |
||
| 549 | * @param string $configurationName |
||
| 550 | * @return string |
||
| 551 | */ |
||
| 552 | public function getIndexQueueAdditionalWhereClauseByConfigurationName($configurationName) |
||
| 563 | |||
| 564 | /** |
||
| 565 | * This method can be used to retrieve all index queue configuration names, where |
||
| 566 | 10 | * a certain table is used. It can be configured with the property "table" or is using the configuration |
|
| 567 | 10 | * key a fallback for the table name. |
|
| 568 | 10 | * |
|
| 569 | 10 | * plugin.tx_solr.index.queue.<configurationName>. |
|
| 570 | 10 | * |
|
| 571 | * @param string $tableName |
||
| 572 | * @param array $defaultIfEmpty |
||
| 573 | * @return array |
||
| 574 | 10 | */ |
|
| 575 | public function getIndexQueueConfigurationNamesByTableName($tableName, $defaultIfEmpty = array()) |
||
| 598 | |||
| 599 | /** |
||
| 600 | * This method is used to retrieve the className of a queue initializer for a certain indexing configuration |
||
| 601 | * of returns the default initializer class, when noting is configured. |
||
| 602 | * |
||
| 603 | * plugin.tx_solr.index.queue.<configurationName>.initialization |
||
| 604 | 26 | * |
|
| 605 | * @param string $configurationName |
||
| 606 | 26 | * @param string $defaultIfEmpty |
|
| 607 | 26 | * @return mixed |
|
| 608 | */ |
||
| 609 | public function getIndexQueueInitializerClassByConfigurationName($configurationName, $defaultIfEmpty = 'ApacheSolrForTypo3\\Solr\\IndexQueue\\Initializer\\Record') |
||
| 616 | |||
| 617 | /** |
||
| 618 | 25 | * Returns the configured javascript file for a specific fileKey. |
|
| 619 | * |
||
| 620 | 25 | * plugin.tx_solr.javascriptFiles.<fileKey> |
|
| 621 | 25 | * |
|
| 622 | * @param string $fileKey |
||
| 623 | * @param string $defaultIfEmpty |
||
| 624 | * @return string |
||
| 625 | */ |
||
| 626 | public function getJavaScriptFileByFileKey($fileKey, $defaultIfEmpty = '') |
||
| 631 | |||
| 632 | 25 | /** |
|
| 633 | * Returns the configuration where to load the javascript |
||
| 634 | 25 | * |
|
| 635 | 25 | * plugin.tx_solr.javascriptFiles.loadIn |
|
| 636 | * |
||
| 637 | * @param string $defaultIfEmpty |
||
| 638 | * @return string |
||
| 639 | */ |
||
| 640 | public function getJavaScriptLoadIn($defaultIfEmpty = 'footer') |
||
| 645 | |||
| 646 | /** |
||
| 647 | * Returns the _LOCAL_LANG configuration from the TypoScript. |
||
| 648 | * |
||
| 649 | * plugin.tx_solr._LOCAL_LANG. |
||
| 650 | * |
||
| 651 | * @param array $defaultIfEmpty |
||
| 652 | * @return array |
||
| 653 | */ |
||
| 654 | public function getLocalLangConfiguration(array $defaultIfEmpty = array()) |
||
| 659 | |||
| 660 | 36 | /** |
|
| 661 | 36 | * When this is enabled the output of the devlog, will be printed as debug output. |
|
| 662 | * |
||
| 663 | * @param bool $defaultIfEmpty |
||
| 664 | * @return bool |
||
| 665 | */ |
||
| 666 | public function getLoggingDebugOutputDevlog($defaultIfEmpty = false) |
||
| 671 | |||
| 672 | 25 | /** |
|
| 673 | * Returns if query filters should be written to the log. |
||
| 674 | 25 | * |
|
| 675 | 25 | * plugin.tx_solr.logging.query.filters |
|
| 676 | * |
||
| 677 | * @param bool $defaultIfEmpty |
||
| 678 | * @return bool |
||
| 679 | */ |
||
| 680 | public function getLoggingQueryFilters($defaultIfEmpty = false) |
||
| 685 | |||
| 686 | 24 | /** |
|
| 687 | * Returns if the querystring should be logged or not. |
||
| 688 | 24 | * |
|
| 689 | 24 | * plugin.tx_solr.logging.query.queryString |
|
| 690 | * |
||
| 691 | * @param bool $defaultIfEmpty |
||
| 692 | * @return bool |
||
| 693 | */ |
||
| 694 | public function getLoggingQueryQueryString($defaultIfEmpty = false) |
||
| 699 | |||
| 700 | 34 | /** |
|
| 701 | * Returns if the searchWords should be logged or not. |
||
| 702 | 34 | * |
|
| 703 | 34 | * plugin.tx_solr.logging.query.searchWords |
|
| 704 | * |
||
| 705 | * @param bool $defaultIfEmpty |
||
| 706 | * @return bool |
||
| 707 | */ |
||
| 708 | public function getLoggingQuerySearchWords($defaultIfEmpty = false) |
||
| 713 | |||
| 714 | 51 | /** |
|
| 715 | * Returns if the rawGet requests should be logged or not. |
||
| 716 | 51 | * |
|
| 717 | 51 | * plugin.tx_solr.logging.query.rawGet |
|
| 718 | * |
||
| 719 | * @param bool $defaultIfEmpty |
||
| 720 | * @return bool |
||
| 721 | */ |
||
| 722 | public function getLoggingQueryRawGet($defaultIfEmpty = false) |
||
| 727 | |||
| 728 | 2 | /** |
|
| 729 | * Returns if the rawPost requests should be logged or not. |
||
| 730 | 2 | * |
|
| 731 | 2 | * plugin.tx_solr.logging.query.rawPost |
|
| 732 | * |
||
| 733 | * @param bool $defaultIfEmpty |
||
| 734 | * @return bool |
||
| 735 | */ |
||
| 736 | public function getLoggingQueryRawPost($defaultIfEmpty = false) |
||
| 741 | |||
| 742 | 1 | /** |
|
| 743 | * Returns if the rawDelete requests should be logged or not. |
||
| 744 | 1 | * |
|
| 745 | 1 | * plugin.tx_solr.logging.query.rawDelete |
|
| 746 | * |
||
| 747 | * @param bool $defaultIfEmpty |
||
| 748 | * @return bool |
||
| 749 | */ |
||
| 750 | public function getLoggingQueryRawDelete($defaultIfEmpty = false) |
||
| 755 | |||
| 756 | 48 | /** |
|
| 757 | * Returns if exceptions should be logged or not. |
||
| 758 | 48 | * |
|
| 759 | 48 | * plugin.tx_solr.logging.exceptions |
|
| 760 | * |
||
| 761 | * @param bool $defaultIfEmpty |
||
| 762 | * @return bool |
||
| 763 | */ |
||
| 764 | public function getLoggingExceptions($defaultIfEmpty = true) |
||
| 769 | |||
| 770 | 12 | /** |
|
| 771 | * Returns if indexing operations should be logged or not. |
||
| 772 | 12 | * |
|
| 773 | 12 | * plugin.tx_solr.logging.indexing |
|
| 774 | * |
||
| 775 | * @param bool $defaultIfEmpty |
||
| 776 | * @return bool |
||
| 777 | */ |
||
| 778 | public function getLoggingIndexing($defaultIfEmpty = false) |
||
| 783 | |||
| 784 | /** |
||
| 785 | * Returns if indexing queue operations should be logged or not. |
||
| 786 | * |
||
| 787 | 13 | * plugin.tx_solr.logging.indexing.queue |
|
| 788 | * |
||
| 789 | * @param bool $defaultIfEmpty |
||
| 790 | 13 | * @return bool |
|
| 791 | 1 | */ |
|
| 792 | public function getLoggingIndexingQueue($defaultIfEmpty = false) |
||
| 797 | |||
| 798 | /** |
||
| 799 | 12 | * This method can be used to check if the logging during indexing should be done. |
|
| 800 | 12 | * It takes the specific configuration by indexQueueConfiguration into account or is using the |
|
| 801 | 12 | * fallback when the logging is enabled on queue or indexing level. |
|
| 802 | * |
||
| 803 | * plugin.tx_solr.logging.indexing.queue.<indexQueueConfiguration> |
||
| 804 | * |
||
| 805 | * @param string $indexQueueConfiguration |
||
| 806 | * @param bool $defaultIfEmpty |
||
| 807 | * @return bool |
||
| 808 | */ |
||
| 809 | public function getLoggingIndexingQueueOperationsByConfigurationNameWithFallBack($indexQueueConfiguration, $defaultIfEmpty = false) |
||
| 825 | |||
| 826 | 6 | /** |
|
| 827 | * Returns if a log message should be written when a page was indexed. |
||
| 828 | 6 | * |
|
| 829 | 6 | * plugin.tx_solr.logging.indexing.pageIndexed |
|
| 830 | |||
| 831 | * @param bool $defaultIfEmpty |
||
| 832 | * @return bool |
||
| 833 | */ |
||
| 834 | public function getLoggingIndexingPageIndexed($defaultIfEmpty = false) |
||
| 839 | |||
| 840 | 7 | /** |
|
| 841 | * Returns if a log message should be written when the TYPO3 search markers are missing in the page. |
||
| 842 | 7 | * |
|
| 843 | 7 | * plugin.tx_solr.logging.indexing.missingTypo3SearchMarkers |
|
| 844 | |||
| 845 | * @param bool $defaultIfEmpty |
||
| 846 | * @return bool |
||
| 847 | */ |
||
| 848 | public function getLoggingIndexingMissingTypo3SearchMarkers($defaultIfEmpty = true) |
||
| 853 | |||
| 854 | 24 | /** |
|
| 855 | * Returns if the initialization of an indexqueue should be logged. |
||
| 856 | 24 | * |
|
| 857 | 24 | * plugin.tx_solr.logging.indexing.indexQueueInitialization |
|
| 858 | * |
||
| 859 | * @param bool $defaultIfEmpty |
||
| 860 | * @return bool |
||
| 861 | */ |
||
| 862 | public function getLoggingIndexingIndexQueueInitialization($defaultIfEmpty = false) |
||
| 867 | |||
| 868 | 67 | /** |
|
| 869 | * Indicates if the debug mode is enabled or not. |
||
| 870 | 67 | * |
|
| 871 | * plugin.tx_solr.enableDebugMode |
||
| 872 | |||
| 873 | * @param bool $defaultIfEmpty |
||
| 874 | * @return bool |
||
| 875 | */ |
||
| 876 | public function getEnabledDebugMode($defaultIfEmpty = false) |
||
| 881 | 24 | ||
| 882 | /** |
||
| 883 | 24 | * Returns the defaultTimeout used for requests to the Solr server |
|
| 884 | 24 | * |
|
| 885 | * plugin.tx_solr.solr.defaultTimeout |
||
| 886 | * |
||
| 887 | * @param float $defaultIfEmpty |
||
| 888 | * @return float |
||
| 889 | */ |
||
| 890 | public function getSolrTimeout($defaultIfEmpty = 0.0) |
||
| 894 | |||
| 895 | 24 | /** |
|
| 896 | * Retrieves the complete search configuration |
||
| 897 | 24 | * |
|
| 898 | 24 | * plugin.tx_solr.search. |
|
| 899 | * |
||
| 900 | * @param array $defaultIfEmpty |
||
| 901 | * @return array |
||
| 902 | */ |
||
| 903 | public function getSearchConfiguration(array $defaultIfEmpty = array()) |
||
| 908 | |||
| 909 | 24 | /** |
|
| 910 | * Indicates if elevation should be used or not |
||
| 911 | 24 | * |
|
| 912 | 24 | * plugin.tx_solr.search.elevation |
|
| 913 | * |
||
| 914 | * @param bool $defaultIfEmpty |
||
| 915 | * @return bool |
||
| 916 | */ |
||
| 917 | public function getSearchElevation($defaultIfEmpty = false) |
||
| 922 | |||
| 923 | 24 | /** |
|
| 924 | * Indicates if elevated results should be marked |
||
| 925 | 24 | * |
|
| 926 | 24 | * plugin.tx_solr.search.elevation.markElevatedResults |
|
| 927 | * |
||
| 928 | * @param bool $defaultIfEmpty |
||
| 929 | * @return bool |
||
| 930 | */ |
||
| 931 | public function getSearchElevationMarkElevatedResults($defaultIfEmpty = true) |
||
| 936 | |||
| 937 | 128 | /** |
|
| 938 | * Indicates if elevation should be forced |
||
| 939 | 128 | * |
|
| 940 | 128 | *plugin.tx_solr.search.elevation.forceElevation |
|
| 941 | * |
||
| 942 | * @param bool $defaultIfEmpty |
||
| 943 | * @return bool |
||
| 944 | */ |
||
| 945 | public function getSearchElevationForceElevation($defaultIfEmpty = true) |
||
| 950 | |||
| 951 | 3 | /** |
|
| 952 | * Indicates if collapsing on a certain field should be used to build variants or not. |
||
| 953 | 3 | * |
|
| 954 | * plugin.tx_solr.search.variants |
||
| 955 | * |
||
| 956 | * @param bool $defaultIfEmpty |
||
| 957 | * @return bool |
||
| 958 | */ |
||
| 959 | public function getSearchVariants($defaultIfEmpty = false) |
||
| 964 | 4 | ||
| 965 | /** |
||
| 966 | 4 | * Indicates if collapsing on a certain field should be used or not |
|
| 967 | 4 | * |
|
| 968 | * plugin.tx_solr.search.variants.variantField |
||
| 969 | * |
||
| 970 | * @param string $defaultIfEmpty |
||
| 971 | * @return string |
||
| 972 | */ |
||
| 973 | public function getSearchVariantsField($defaultIfEmpty = 'variantId') |
||
| 977 | |||
| 978 | 2 | /** |
|
| 979 | * Indicates if expanding of collapsed items it activated. |
||
| 980 | 2 | * |
|
| 981 | 2 | * plugin.tx_solr.search.variants.expand |
|
| 982 | * |
||
| 983 | * @param bool $defaultIfEmpty |
||
| 984 | * @return bool |
||
| 985 | */ |
||
| 986 | public function getSearchVariantsExpand($defaultIfEmpty = false) |
||
| 991 | |||
| 992 | 23 | /** |
|
| 993 | * Retrieves the number of elements that should be expanded. |
||
| 994 | 23 | * |
|
| 995 | 23 | * plugin.tx_solr.search.variants.limit |
|
| 996 | * |
||
| 997 | * @param int $defaultIfEmpty |
||
| 998 | * @return int |
||
| 999 | */ |
||
| 1000 | public function getSearchVariantsLimit($defaultIfEmpty = 10) |
||
| 1005 | |||
| 1006 | 23 | /** |
|
| 1007 | * Indicates if frequent searches should be show or not. |
||
| 1008 | 23 | * |
|
| 1009 | 23 | * plugin.tx_solr.search.frequentSearches |
|
| 1010 | * |
||
| 1011 | * @param bool $defaultIfEmpty |
||
| 1012 | * @return bool |
||
| 1013 | */ |
||
| 1014 | public function getSearchFrequentSearches($defaultIfEmpty = false) |
||
| 1019 | |||
| 1020 | /** |
||
| 1021 | * Returns the sub configuration of the frequentSearches |
||
| 1022 | * |
||
| 1023 | * plugin.tx_solr.search.frequentSearches. |
||
| 1024 | * |
||
| 1025 | * @param array $defaultIfEmpty |
||
| 1026 | * @return array |
||
| 1027 | */ |
||
| 1028 | public function getSearchFrequentSearchesConfiguration($defaultIfEmpty = array()) |
||
| 1033 | |||
| 1034 | /** |
||
| 1035 | * Retrieves the minimum font size that should be used for the frequentSearches. |
||
| 1036 | * |
||
| 1037 | * plugin.tx_solr.search.frequentSearches.minSize |
||
| 1038 | * |
||
| 1039 | * @param int $defaultIfEmpty |
||
| 1040 | * @return int |
||
| 1041 | */ |
||
| 1042 | public function getSearchFrequentSearchesMinSize($defaultIfEmpty = 14) |
||
| 1047 | |||
| 1048 | 18 | /** |
|
| 1049 | * Retrieves the maximum font size that should be used for the frequentSearches. |
||
| 1050 | 18 | * |
|
| 1051 | 18 | * plugin.tx_solr.search.frequentSearches.minSize |
|
| 1052 | * |
||
| 1053 | * @param int $defaultIfEmpty |
||
| 1054 | * @return int |
||
| 1055 | */ |
||
| 1056 | public function getSearchFrequentSearchesMaxSize($defaultIfEmpty = 32) |
||
| 1061 | |||
| 1062 | 26 | /** |
|
| 1063 | * Indicates if frequent searches should be show or not. |
||
| 1064 | 26 | * |
|
| 1065 | 26 | * plugin.tx_solr.search.frequentSearches.useLowercaseKeywords |
|
| 1066 | * |
||
| 1067 | * @param bool $defaultIfEmpty |
||
| 1068 | * @return bool |
||
| 1069 | */ |
||
| 1070 | public function getSearchFrequentSearchesUseLowercaseKeywords($defaultIfEmpty = false) |
||
| 1075 | |||
| 1076 | 26 | /** |
|
| 1077 | * Returns the configuration if the search should be initialized with an empty query. |
||
| 1078 | 26 | * |
|
| 1079 | 26 | * plugin.tx_solr.search.initializeWithEmptyQuery |
|
| 1080 | * |
||
| 1081 | * @param bool $defaultIfEmpty |
||
| 1082 | * @return bool |
||
| 1083 | */ |
||
| 1084 | public function getSearchInitializeWithEmptyQuery($defaultIfEmpty = false) |
||
| 1089 | |||
| 1090 | 23 | /** |
|
| 1091 | * Returns the configured initial query |
||
| 1092 | 23 | * |
|
| 1093 | 23 | * plugin.tx_solr.search.initializeWithQuery |
|
| 1094 | * |
||
| 1095 | * @param string $defaultIfEmpty |
||
| 1096 | * @return string |
||
| 1097 | */ |
||
| 1098 | public function getSearchInitializeWithQuery($defaultIfEmpty = '') |
||
| 1103 | |||
| 1104 | 23 | /** |
|
| 1105 | * Returns if the last searches should be displayed or not. |
||
| 1106 | 23 | * |
|
| 1107 | 23 | * plugin.tx_solr.search.lastSearches |
|
| 1108 | * |
||
| 1109 | * @param bool $defaultIfEmpty |
||
| 1110 | * @return bool |
||
| 1111 | */ |
||
| 1112 | public function getSearchLastSearches($defaultIfEmpty = false) |
||
| 1117 | |||
| 1118 | 23 | /** |
|
| 1119 | * Returns the lastSearch mode. "user" for user specific |
||
| 1120 | 23 | * |
|
| 1121 | 23 | * plugin.tx_solr.search.lastSearches.mode |
|
| 1122 | * |
||
| 1123 | * @param string $defaultIfEmpty |
||
| 1124 | * @return string |
||
| 1125 | */ |
||
| 1126 | public function getSearchLastSearchesMode($defaultIfEmpty = 'user') |
||
| 1131 | |||
| 1132 | 18 | /** |
|
| 1133 | * Returns the lastSearch limit |
||
| 1134 | 18 | * |
|
| 1135 | 18 | * plugin.tx_solr.search.lastSearches.limit |
|
| 1136 | * |
||
| 1137 | * @param int $defaultIfEmpty |
||
| 1138 | * @return int |
||
| 1139 | */ |
||
| 1140 | public function getSearchLastSearchesLimit($defaultIfEmpty = 10) |
||
| 1145 | |||
| 1146 | 18 | /** |
|
| 1147 | * Returns the search results fieldProcessingInstructions configuration array |
||
| 1148 | 18 | * |
|
| 1149 | 18 | * plugin.tx_solr.search.results.fieldProcessingInstructions. |
|
| 1150 | * |
||
| 1151 | * @param array $defaultIfEmpty |
||
| 1152 | * @return array |
||
| 1153 | */ |
||
| 1154 | public function getSearchResultsFieldProcessingInstructionsConfiguration(array $defaultIfEmpty = array()) |
||
| 1159 | |||
| 1160 | 4 | /** |
|
| 1161 | * Returns the search results fieldRenderingInstructions configuration array |
||
| 1162 | 4 | * |
|
| 1163 | 4 | * plugin.tx_solr.search.results.fieldRenderingInstructions. |
|
| 1164 | * |
||
| 1165 | * @param array $defaultIfEmpty |
||
| 1166 | * @return array |
||
| 1167 | */ |
||
| 1168 | public function getSearchResultsFieldRenderingInstructionsConfiguration(array $defaultIfEmpty = array()) |
||
| 1173 | |||
| 1174 | 4 | /** |
|
| 1175 | * Indicates if the results of an initial empty query should be shown or not. |
||
| 1176 | 4 | * |
|
| 1177 | 4 | * plugin.tx_solr.search.showResultsOfInitialEmptyQuery |
|
| 1178 | * |
||
| 1179 | * @param bool $defaultIfEmpty |
||
| 1180 | * @return bool |
||
| 1181 | */ |
||
| 1182 | public function getSearchShowResultsOfInitialEmptyQuery($defaultIfEmpty = false) |
||
| 1187 | |||
| 1188 | 17 | /** |
|
| 1189 | * Indicates if the results of an initial search query should be shown. |
||
| 1190 | 17 | * |
|
| 1191 | 17 | * plugin.tx_solr.search.showResultsOfInitialQuery |
|
| 1192 | * |
||
| 1193 | * @param bool $defaultIfEmpty |
||
| 1194 | * @return bool |
||
| 1195 | */ |
||
| 1196 | public function getSearchShowResultsOfInitialQuery($defaultIfEmpty = false) |
||
| 1201 | |||
| 1202 | 17 | /** |
|
| 1203 | * Indicates if sorting was enabled or not. |
||
| 1204 | 17 | * |
|
| 1205 | 17 | * plugin.tx_solr.search.sorting |
|
| 1206 | * |
||
| 1207 | * @param bool $defaultIfEmpty |
||
| 1208 | * @return bool |
||
| 1209 | */ |
||
| 1210 | public function getSearchSorting($defaultIfEmpty = false) |
||
| 1215 | |||
| 1216 | /** |
||
| 1217 | * Returns the sorting options configurations. |
||
| 1218 | * |
||
| 1219 | * plugin.tx_solr.search.sorting.options. |
||
| 1220 | * |
||
| 1221 | * @param array $defaultIfEmpty |
||
| 1222 | 17 | * @return array |
|
| 1223 | */ |
||
| 1224 | 17 | public function getSearchSortingOptionsConfiguration($defaultIfEmpty = array()) |
|
| 1229 | |||
| 1230 | /** |
||
| 1231 | * Retrieves the sorting default order for a sort option. |
||
| 1232 | * |
||
| 1233 | 17 | * plugin.tx_solr.search.sorting.options.<sortOptionName>.defaultOrder |
|
| 1234 | 17 | * |
|
| 1235 | 17 | * or |
|
| 1236 | * |
||
| 1237 | * plugin.tx_solr.search.sorting.defaultOrder |
||
| 1238 | * |
||
| 1239 | * |
||
| 1240 | * @param string $sortOptionName |
||
| 1241 | * @param string $defaultIfEmpty |
||
| 1242 | * @return string |
||
| 1243 | */ |
||
| 1244 | public function getSearchSortingDefaultOrderBySortOptionName($sortOptionName = '', $defaultIfEmpty = 'asc') |
||
| 1259 | 18 | ||
| 1260 | /** |
||
| 1261 | 18 | * Returns the configured fixedOrder, if nothing configured defaultIfEmpty will be returned. |
|
| 1262 | * |
||
| 1263 | 18 | * plugin.tx_solr.search.sorting.options.<sortOptionName>.fixedOrder |
|
| 1264 | * |
||
| 1265 | * @param string $sortOptionName |
||
| 1266 | * @param string $defaultIfEmpty |
||
| 1267 | 18 | * @return string |
|
| 1268 | */ |
||
| 1269 | public function getSearchSortingFixedOrderBySortOptionName($sortOptionName = '', $defaultIfEmpty = '') |
||
| 1274 | |||
| 1275 | /** |
||
| 1276 | * Returns the trusted fields configured for the search that do not need to be escaped. |
||
| 1277 | * |
||
| 1278 | 23 | * @param array $defaultIfEmpty |
|
| 1279 | * @return array |
||
| 1280 | 23 | */ |
|
| 1281 | 23 | public function getSearchTrustedFieldsArray($defaultIfEmpty = array('url')) |
|
| 1291 | |||
| 1292 | 26 | /** |
|
| 1293 | * Indicates if the plugin arguments should be kept in the search form for a second submission. |
||
| 1294 | 26 | * |
|
| 1295 | 26 | * plugin.tx_solr.search.keepExistingParametersForNewSearches |
|
| 1296 | * |
||
| 1297 | * @param bool $defaultIfEmpty |
||
| 1298 | * @return bool |
||
| 1299 | */ |
||
| 1300 | public function getSearchKeepExistingParametersForNewSearches($defaultIfEmpty = false) |
||
| 1305 | |||
| 1306 | 32 | /** |
|
| 1307 | * Returns if an empty query is allowed on the query level. |
||
| 1308 | 32 | * |
|
| 1309 | 32 | * plugin.tx_solr.search.query.allowEmptyQuery |
|
| 1310 | * |
||
| 1311 | * @param string $defaultIfEmpty |
||
| 1312 | * @return string |
||
| 1313 | */ |
||
| 1314 | public function getSearchQueryAllowEmptyQuery($defaultIfEmpty = '') |
||
| 1319 | 1 | ||
| 1320 | /** |
||
| 1321 | 1 | * Returns the fieldProcessingInstructions configuration array |
|
| 1322 | 1 | * |
|
| 1323 | * plugin.tx_solr.search.query.filter. |
||
| 1324 | * |
||
| 1325 | * @param array $defaultIfEmpty |
||
| 1326 | * @return array |
||
| 1327 | */ |
||
| 1328 | public function getSearchQueryFilterConfiguration(array $defaultIfEmpty = array()) |
||
| 1333 | |||
| 1334 | /** |
||
| 1335 | * Can be used to overwrite the filterConfiguration. |
||
| 1336 | * |
||
| 1337 | * plugin.tx_solr.search.query.filter. |
||
| 1338 | * |
||
| 1339 | * @param array $configuration |
||
| 1340 | */ |
||
| 1341 | public function setSearchQueryFilterConfiguration(array $configuration) |
||
| 1345 | |||
| 1346 | /** |
||
| 1347 | * Removes the pageSections filter setting. |
||
| 1348 | * |
||
| 1349 | * @return void |
||
| 1350 | */ |
||
| 1351 | public function removeSearchQueryFilterForPageSections() |
||
| 1355 | 129 | ||
| 1356 | /** |
||
| 1357 | 129 | * Returns the configured queryFields from TypoScript |
|
| 1358 | 129 | * |
|
| 1359 | 103 | * plugin.tx_solr.search.query.queryFields |
|
| 1360 | * |
||
| 1361 | 26 | * @param string $defaultIfEmpty |
|
| 1362 | * @return string |
||
| 1363 | */ |
||
| 1364 | public function getSearchQueryQueryFields($defaultIfEmpty = '') |
||
| 1368 | |||
| 1369 | /** |
||
| 1370 | * Returns the configured returnFields as array. |
||
| 1371 | * |
||
| 1372 | 134 | * plugin.tx_solr.search.query.returnFields |
|
| 1373 | * |
||
| 1374 | 134 | * @param array $defaultIfEmpty |
|
| 1375 | 134 | * @return array |
|
| 1376 | */ |
||
| 1377 | 83 | public function getSearchQueryReturnFieldsAsArray($defaultIfEmpty = array()) |
|
| 1385 | |||
| 1386 | /** |
||
| 1387 | * Returns the configured target page for the search. |
||
| 1388 | * By default the contextPageId will be used |
||
| 1389 | * |
||
| 1390 | * plugin.tx_solr.search.targetPage |
||
| 1391 | 28 | * |
|
| 1392 | * @return int |
||
| 1393 | 28 | */ |
|
| 1394 | 28 | public function getSearchTargetPage() |
|
| 1404 | |||
| 1405 | 18 | /** |
|
| 1406 | * Retrieves the targetPage configuration. |
||
| 1407 | 18 | * |
|
| 1408 | 18 | * plugin.tx_solr.search.targetPage. |
|
| 1409 | * |
||
| 1410 | * @param array $defaultIfEmpty |
||
| 1411 | * @return array |
||
| 1412 | */ |
||
| 1413 | public function getSearchTargetPageConfiguration(array $defaultIfEmpty = array()) |
||
| 1418 | |||
| 1419 | 31 | /** |
|
| 1420 | * Retrieves the pagebrowser configuration. |
||
| 1421 | 31 | * |
|
| 1422 | * plugin.tx_solr.search.results.pagebrowser. |
||
| 1423 | * |
||
| 1424 | * @param array $defaultIfEmpty |
||
| 1425 | * @return array |
||
| 1426 | */ |
||
| 1427 | public function getSearchResultsPageBrowserConfiguration(array $defaultIfEmpty = array()) |
||
| 1432 | 18 | ||
| 1433 | /** |
||
| 1434 | 18 | * Returns the result highlighting fields. |
|
| 1435 | * |
||
| 1436 | 18 | * plugin.tx_solr.search.results.resultsHighlighting.highlightFields |
|
| 1437 | * |
||
| 1438 | * @param string $defaultIfEmpty |
||
| 1439 | * @return string |
||
| 1440 | 18 | */ |
|
| 1441 | public function getSearchResultsHighlightingFields($defaultIfEmpty = '') |
||
| 1445 | |||
| 1446 | /** |
||
| 1447 | * Returns the result highlighting fields as array. |
||
| 1448 | * |
||
| 1449 | * plugin.tx_solr.search.results.resultsHighlighting.highlightFields |
||
| 1450 | * |
||
| 1451 | 18 | * @param array $defaultIfEmpty |
|
| 1452 | * @return array |
||
| 1453 | 18 | */ |
|
| 1454 | public function getSearchResultsHighlightingFieldsAsArray($defaultIfEmpty = array()) |
||
| 1464 | 24 | ||
| 1465 | /** |
||
| 1466 | 24 | * Returns the fragmentSeparator for highlighted segments. |
|
| 1467 | * |
||
| 1468 | * plugin.tx_solr.search.results.resultsHighlighting.fragmentSeparator |
||
| 1469 | * |
||
| 1470 | * @param string $defaultIfEmpty |
||
| 1471 | * @return string |
||
| 1472 | */ |
||
| 1473 | public function getSearchResultsHighlightingFragmentSeparator($defaultIfEmpty = '[...]') |
||
| 1477 | 24 | ||
| 1478 | /** |
||
| 1479 | 24 | * Returns the number of results that should be shown per page. |
|
| 1480 | * |
||
| 1481 | 24 | * plugin.tx_solr.search.results.resultsPerPage |
|
| 1482 | * |
||
| 1483 | * @param int $defaultIfEmpty |
||
| 1484 | * @return int |
||
| 1485 | 24 | */ |
|
| 1486 | public function getSearchResultsPerPage($defaultIfEmpty = 10) |
||
| 1490 | |||
| 1491 | /** |
||
| 1492 | * Returns the available options for the per page switch. |
||
| 1493 | * |
||
| 1494 | * plugin.tx_solr.search.results.resultsPerPageSwitchOptions |
||
| 1495 | * |
||
| 1496 | 31 | * @param array $defaultIfEmpty |
|
| 1497 | * @return array |
||
| 1498 | 31 | */ |
|
| 1499 | public function getSearchResultsPerPageSwitchOptionsAsArray($defaultIfEmpty = array()) |
||
| 1509 | 25 | ||
| 1510 | /** |
||
| 1511 | 25 | * Returns the configured wrap for the resultHighlighting. |
|
| 1512 | 25 | * |
|
| 1513 | * plugin.tx_solr.search.results.resultsHighlighting.wrap |
||
| 1514 | * |
||
| 1515 | * @param string $defaultIfEmpty |
||
| 1516 | * @return string |
||
| 1517 | */ |
||
| 1518 | public function getSearchResultsHighlightingWrap($defaultIfEmpty = '') |
||
| 1522 | |||
| 1523 | 5 | /** |
|
| 1524 | * Indicates if spellchecking is enabled or not. |
||
| 1525 | 5 | * |
|
| 1526 | * plugin.tx_solr.search.spellchecking |
||
| 1527 | * |
||
| 1528 | * @param bool $defaultIfEmpty |
||
| 1529 | * @return bool |
||
| 1530 | */ |
||
| 1531 | public function getSearchSpellchecking($defaultIfEmpty = false) |
||
| 1536 | 22 | ||
| 1537 | /** |
||
| 1538 | 22 | * Returns the wrap that should be used for spellchecking |
|
| 1539 | * |
||
| 1540 | * plugin.tx_solr.search.spellchecking.wrap |
||
| 1541 | * |
||
| 1542 | * @param string $defaultIfEmpty |
||
| 1543 | * @return string |
||
| 1544 | */ |
||
| 1545 | public function getSearchSpellcheckingWrap($defaultIfEmpty = '') |
||
| 1549 | 3 | ||
| 1550 | /** |
||
| 1551 | 3 | * Returns the numberOfSuggestionsToTry that should be used for the spellchecking. |
|
| 1552 | 3 | * |
|
| 1553 | * plugin.tx_solr.search.spellchecking.numberOfSuggestionsToTry |
||
| 1554 | * |
||
| 1555 | * @param int $defaultIfEmpty |
||
| 1556 | * @return int |
||
| 1557 | */ |
||
| 1558 | public function getSearchSpellcheckingNumberOfSuggestionsToTry($defaultIfEmpty = 0) |
||
| 1562 | |||
| 1563 | 20 | /** |
|
| 1564 | * Indicates if a second search should be fired from the spellchecking suggestion if no results could be found. |
||
| 1565 | 20 | * |
|
| 1566 | 20 | * plugin.tx_solr.search.spellchecking.searchUsingSpellCheckerSuggestion |
|
| 1567 | * |
||
| 1568 | * @param bool $defaultIfEmpty |
||
| 1569 | * @return bool |
||
| 1570 | */ |
||
| 1571 | public function getSearchSpellcheckingSearchUsingSpellCheckerSuggestion($defaultIfEmpty = false) |
||
| 1576 | |||
| 1577 | /** |
||
| 1578 | * Indicates if faceting is enabled or not. |
||
| 1579 | * |
||
| 1580 | * plugin.tx_solr.search.faceting |
||
| 1581 | * |
||
| 1582 | * @param bool $defaultIfEmpty |
||
| 1583 | * @return bool |
||
| 1584 | 19 | */ |
|
| 1585 | public function getSearchFaceting($defaultIfEmpty = false) |
||
| 1590 | 19 | ||
| 1591 | 1 | /** |
|
| 1592 | * Retrieves the facetLinkATagParams for a facet by facet name. If nothing specific is configured |
||
| 1593 | * the global facetLinkATagParams with be returned. |
||
| 1594 | * |
||
| 1595 | 19 | * plugin.tx_solr.search.faceting.facets.<facetName>.facetLinkATagParams |
|
| 1596 | 19 | * |
|
| 1597 | 19 | * or |
|
| 1598 | * |
||
| 1599 | * plugin.tx_solr.search.faceting.facetLinkATagParams |
||
| 1600 | * |
||
| 1601 | * |
||
| 1602 | * @param string $facetName |
||
| 1603 | * @param string $defaultIfEmpty |
||
| 1604 | * @return string |
||
| 1605 | */ |
||
| 1606 | public function getSearchFacetingFacetLinkATagParamsByName($facetName = '', $defaultIfEmpty = '') |
||
| 1621 | |||
| 1622 | /** |
||
| 1623 | * Returns the test that should be used to remove a faceting link |
||
| 1624 | * |
||
| 1625 | * plugin.tx_solr.search.faceting.removeFacetLinkText |
||
| 1626 | * |
||
| 1627 | * @param string $defaultIfEmpty |
||
| 1628 | 19 | * @return string |
|
| 1629 | */ |
||
| 1630 | 19 | public function getSearchFacetingRemoveFacetLinkText($defaultIfEmpty = '@facetLabel: @facetText') |
|
| 1634 | 19 | ||
| 1635 | 1 | /** |
|
| 1636 | * Retrieves the showEvenWhenEmpty for a facet by facet name. If nothing specific is configured |
||
| 1637 | * the global showEmptyFacets with be returned. |
||
| 1638 | * |
||
| 1639 | 19 | * plugin.tx_solr.search.faceting.facets.<facetName>.showEvenWhenEmpty |
|
| 1640 | 19 | * |
|
| 1641 | 19 | * or |
|
| 1642 | * |
||
| 1643 | * plugin.tx_solr.search.faceting.showEmptyFacets |
||
| 1644 | * |
||
| 1645 | * |
||
| 1646 | * @param string $facetName |
||
| 1647 | * @param bool $defaultIfEmpty |
||
| 1648 | * @return bool |
||
| 1649 | */ |
||
| 1650 | public function getSearchFacetingShowEmptyFacetsByName($facetName = '', $defaultIfEmpty = false) |
||
| 1665 | 18 | ||
| 1666 | /** |
||
| 1667 | 18 | * Returns the wrap for the faceting show all link |
|
| 1668 | * |
||
| 1669 | 18 | * plugin.tx_solr.search.faceting.showAllLink.wrap |
|
| 1670 | * |
||
| 1671 | * @param string $defaultIfEmpty |
||
| 1672 | * @return string |
||
| 1673 | */ |
||
| 1674 | public function getSearchFacetingShowAllLinkWrap($defaultIfEmpty = '') |
||
| 1678 | |||
| 1679 | /** |
||
| 1680 | 18 | * Returns the link url parameters that should be added to a facet. |
|
| 1681 | * |
||
| 1682 | 18 | * plugin.tx_solr.search.faceting.facetLinkUrlParameters |
|
| 1683 | 18 | * |
|
| 1684 | * @param string $defaultIfEmpty |
||
| 1685 | * @return string |
||
| 1686 | */ |
||
| 1687 | public function getSearchFacetingFacetLinkUrlParameters($defaultIfEmpty = '') |
||
| 1693 | |||
| 1694 | 18 | /** |
|
| 1695 | * Returns if the facetLinkUrlsParameters should be included in the reset link. |
||
| 1696 | 18 | * |
|
| 1697 | 18 | * plugin.tx_solr.search.faceting.facetLinkUrlParameters.useForFacetResetLinkUrl |
|
| 1698 | * |
||
| 1699 | * @param bool $defaultIfEmpty |
||
| 1700 | * @return bool |
||
| 1701 | 18 | */ |
|
| 1702 | public function getSearchFacetingFacetLinkUrlParametersUseForFacetResetLinkUrl($defaultIfEmpty = true) |
||
| 1707 | |||
| 1708 | /** |
||
| 1709 | * Returns the link url parameters that should be added to a facet as array. |
||
| 1710 | * |
||
| 1711 | * plugin.tx_solr.search.faceting.facetLinkUrlParameters |
||
| 1712 | 31 | * |
|
| 1713 | * @param array $defaultIfEmpty |
||
| 1714 | 31 | * @return array |
|
| 1715 | */ |
||
| 1716 | public function getSearchFacetingFacetLinkUrlParametersAsArray($defaultIfEmpty = array()) |
||
| 1725 | 18 | ||
| 1726 | /** |
||
| 1727 | 18 | * Return the configured minimumCount value for facets. |
|
| 1728 | * |
||
| 1729 | * plugin.tx_solr.search.faceting.minimumCount |
||
| 1730 | * |
||
| 1731 | * @param int $defaultIfEmpty |
||
| 1732 | * @return int |
||
| 1733 | */ |
||
| 1734 | public function getSearchFacetingMinimumCount($defaultIfEmpty = 1) |
||
| 1738 | 31 | ||
| 1739 | /** |
||
| 1740 | 31 | * Return the configured limit value for facets, used for displaying. |
|
| 1741 | * |
||
| 1742 | * plugin.tx_solr.search.faceting.limit |
||
| 1743 | * |
||
| 1744 | * @param int $defaultIfEmpty |
||
| 1745 | * @return int |
||
| 1746 | */ |
||
| 1747 | public function getSearchFacetingLimit($defaultIfEmpty = 10) |
||
| 1751 | 1 | ||
| 1752 | /** |
||
| 1753 | 1 | * Return the configured limit value for facets, used for the response. |
|
| 1754 | 1 | * |
|
| 1755 | * plugin.tx_solr.search.faceting.facetLimit |
||
| 1756 | * |
||
| 1757 | * @param int $defaultIfEmpty |
||
| 1758 | * @return int |
||
| 1759 | */ |
||
| 1760 | public function getSearchFacetingFacetLimit($defaultIfEmpty = 100) |
||
| 1764 | |||
| 1765 | 31 | /** |
|
| 1766 | * Returns if the singleFacetMode is active or not. |
||
| 1767 | 31 | * |
|
| 1768 | * plugin.tx_solr.search.faceting.singleFacetMode |
||
| 1769 | * |
||
| 1770 | * @param bool $defaultIfEmpty |
||
| 1771 | * @return bool |
||
| 1772 | */ |
||
| 1773 | public function getSearchFacetingSingleFacetMode($defaultIfEmpty = false) |
||
| 1778 | |||
| 1779 | /** |
||
| 1780 | 27 | * Return the configured faceting sortBy value. |
|
| 1781 | * |
||
| 1782 | 27 | * plugin.tx_solr.search.faceting.sortBy |
|
| 1783 | 27 | * |
|
| 1784 | * @param string $defaultIfEmpty |
||
| 1785 | * @return string |
||
| 1786 | */ |
||
| 1787 | public function getSearchFacetingSortBy($defaultIfEmpty = '') |
||
| 1791 | |||
| 1792 | /** |
||
| 1793 | * Returns if a facets should be kept on selection. Global faceting setting |
||
| 1794 | 27 | * can also be configured on facet level by using |
|
| 1795 | * (plugin.tx_solr.search.faceting.facets.<fieldName>.keepAllOptionsOnSelection) |
||
| 1796 | 27 | * |
|
| 1797 | * plugin.tx_solr.search.faceting.keepAllFacetsOnSelection |
||
| 1798 | * |
||
| 1799 | * @param bool $defaultIfEmpty |
||
| 1800 | * @return bool |
||
| 1801 | */ |
||
| 1802 | public function getSearchFacetingKeepAllFacetsOnSelection($defaultIfEmpty = false) |
||
| 1807 | |||
| 1808 | 18 | /** |
|
| 1809 | * Returns the configured faceting configuration. |
||
| 1810 | 18 | * |
|
| 1811 | * plugin.tx_solr.search.faceting.facets |
||
| 1812 | * |
||
| 1813 | * @param array $defaultIfEmpty |
||
| 1814 | * @return array |
||
| 1815 | */ |
||
| 1816 | public function getSearchFacetingFacets(array $defaultIfEmpty = array()) |
||
| 1820 | |||
| 1821 | 24 | /** |
|
| 1822 | * Returns the configuration of a single facet by facet name. |
||
| 1823 | 24 | * |
|
| 1824 | 24 | * plugin.tx_solr.search.faceting.facets.<facetName> |
|
| 1825 | * |
||
| 1826 | * @param string $facetName |
||
| 1827 | * @param array $defaultIfEmpty |
||
| 1828 | * @return array |
||
| 1829 | */ |
||
| 1830 | public function getSearchFacetingFacetByName($facetName, $defaultIfEmpty = array()) |
||
| 1834 | |||
| 1835 | 18 | /** |
|
| 1836 | * Indicates if statistics is enabled or not. |
||
| 1837 | 18 | * |
|
| 1838 | 18 | * plugin.tx_solr.statistics |
|
| 1839 | * |
||
| 1840 | * @param bool $defaultIfEmpty |
||
| 1841 | * @return bool |
||
| 1842 | */ |
||
| 1843 | public function getStatistics($defaultIfEmpty = false) |
||
| 1848 | |||
| 1849 | 25 | /** |
|
| 1850 | * Indicates to which length an ip should be anonymized in the statistics |
||
| 1851 | 25 | * |
|
| 1852 | 25 | * plugin.tx_solr.statistics.anonymizeIP |
|
| 1853 | * |
||
| 1854 | * @param int $defaultIfEmpty |
||
| 1855 | * @return int |
||
| 1856 | */ |
||
| 1857 | public function getStatisticsAnonymizeIP($defaultIfEmpty = 0) |
||
| 1862 | |||
| 1863 | 25 | /** |
|
| 1864 | * Indicates if suggestion is enabled or not. |
||
| 1865 | 25 | * |
|
| 1866 | 25 | * plugin.tx_solr.suggest |
|
| 1867 | * |
||
| 1868 | * @param bool $defaultIfEmpty |
||
| 1869 | * @return bool |
||
| 1870 | */ |
||
| 1871 | public function getSuggest($defaultIfEmpty = false) |
||
| 1876 | |||
| 1877 | /** |
||
| 1878 | 25 | * Indicates if https should be used for the suggest form. |
|
| 1879 | * |
||
| 1880 | 25 | * plugin.tx_solr.suggest.forceHttps |
|
| 1881 | 25 | * |
|
| 1882 | * @param bool $defaultIfEmpty |
||
| 1883 | * @return bool |
||
| 1884 | */ |
||
| 1885 | public function getSuggestForceHttps($defaultIfEmpty = false) |
||
| 1890 | |||
| 1891 | /** |
||
| 1892 | 1 | * Returns the configured template for a specific template fileKey. |
|
| 1893 | * |
||
| 1894 | 1 | * plugin.tx_solr.search.templateFiles.<fileKey> |
|
| 1895 | 1 | * |
|
| 1896 | * @param string $fileKey |
||
| 1897 | * @param string $defaultIfEmpty |
||
| 1898 | * @return string |
||
| 1899 | */ |
||
| 1900 | public function getTemplateByFileKey($fileKey, $defaultIfEmpty = '') |
||
| 1905 | |||
| 1906 | 17 | /** |
|
| 1907 | * Returns the configuration of the crop view helper. |
||
| 1908 | 17 | * |
|
| 1909 | 17 | * plugin.tx_solr.viewHelpers.crop. |
|
| 1910 | * |
||
| 1911 | * @param array $defaultIfEmpty |
||
| 1912 | * @return array |
||
| 1913 | */ |
||
| 1914 | public function getViewHelpersCropConfiguration(array $defaultIfEmpty = array()) |
||
| 1919 | |||
| 1920 | /** |
||
| 1921 | * Returns the configuration of the sorting view helper. |
||
| 1922 | * |
||
| 1923 | * plugin.tx_solr.viewHelpers.sortIndicator. |
||
| 1924 | * |
||
| 1925 | * @param array $defaultIfEmpty |
||
| 1926 | * @return array |
||
| 1927 | */ |
||
| 1928 | public function getViewHelpersSortIndicatorConfiguration(array $defaultIfEmpty = array()) |
||
| 1933 | } |
||
| 1934 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: