PHP Class Sulu\Bundle\MediaBundle\Search\Subscriber\StructureMediaSearchSubscriber

Inheritance: implements Symfony\Component\EventDispatcher\EventSubscriberInterface
Show file Open project: sulu/sulu

Protected Properties

Property Type Description
$mediaManager Sulu\Bundle\MediaBundle\Media\Manager\MediaManagerInterface
$requestAnalyzer Sulu\Component\Webspace\Analyzer\RequestAnalyzerInterface
$searchImageFormat string The format of the image, which will be returned in the search.

Public Methods

Method Description
__construct ( Sulu\Bundle\MediaBundle\Media\Manager\MediaManagerInterface $mediaManager, Sulu\Component\Webspace\Analyzer\RequestAnalyzerInterface $requestAnalyzer = null, $searchImageFormat )
getSubscribedEvents ( ) : array Returns the events this subscriber has subscribed.
handlePreIndex ( Massive\Bundle\SearchBundle\Search\Event\PreIndexEvent $e ) Adds the image to the search document.

Private Methods

Method Description
getImageUrl ( $data, $locale ) Returns the url for the image.

Method Details

__construct() public method

public __construct ( Sulu\Bundle\MediaBundle\Media\Manager\MediaManagerInterface $mediaManager, Sulu\Component\Webspace\Analyzer\RequestAnalyzerInterface $requestAnalyzer = null, $searchImageFormat )
$mediaManager Sulu\Bundle\MediaBundle\Media\Manager\MediaManagerInterface
$requestAnalyzer Sulu\Component\Webspace\Analyzer\RequestAnalyzerInterface
$searchImageFormat

getSubscribedEvents() public static method

Returns the events this subscriber has subscribed.
public static getSubscribedEvents ( ) : array
return array

handlePreIndex() public method

Adds the image to the search document.
public handlePreIndex ( Massive\Bundle\SearchBundle\Search\Event\PreIndexEvent $e )
$e Massive\Bundle\SearchBundle\Search\Event\PreIndexEvent

Property Details

$mediaManager protected property

protected MediaManagerInterface,Sulu\Bundle\MediaBundle\Media\Manager $mediaManager
return Sulu\Bundle\MediaBundle\Media\Manager\MediaManagerInterface

$requestAnalyzer protected property

protected RequestAnalyzerInterface,Sulu\Component\Webspace\Analyzer $requestAnalyzer
return Sulu\Component\Webspace\Analyzer\RequestAnalyzerInterface

$searchImageFormat protected property

The format of the image, which will be returned in the search.
protected string $searchImageFormat
return string