Smile\ElasticsuiteCore\Helper\Autocomplete::getMaxSize PHP Method

getMaxSize() public method

Retrieve Max Size for a given type of autocomplete results
public getMaxSize ( string $type = null ) : integer
$type string The type of autocomplete element
return integer
    public function getMaxSize($type = null)
    {
        if ($type === null) {
            throw new \LogicException('Autocomplete type is missing');
        }
        $configPath = sprintf("%s_autocomplete/max_size", $type);
        return (int) $this->getConfigValue($configPath);
    }

Usage Example

Example #1
0
 /**
  * Retrieve number of products to display in autocomplete results
  *
  * @return int
  */
 private function getResultsPageSize()
 {
     return $this->configurationHelper->getMaxSize($this->getType());
 }