PHP Класс MetaModels\Filter\Setting\Simple

Наследование: implements MetaModels\Filter\Setting\ISimple
Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( MetaModels\Filter\Setting\ICollection $collection, array $data ) Constructor - initialize the object and store the parameters.
generateFilterUrlFrom ( MetaModels\IItem $objItem, MetaModels\Render\Setting\ICollection $objRenderSetting )
get ( $strKey )
getEventDispatcher ( ) : Symfony\Component\EventDispatcher\EventDispatcherInterface Retrieve the event dispatcher.
getFilterSettings ( ) : MetaModels\Filter\Setting\ICollection Get the parenting collection instance.
getMetaModel ( ) : MetaModels\IMetaModel Return the MetaModel instance this filter setting relates to.
getParameterDCA ( )
getParameterFilterNames ( )
getParameterFilterWidgets ( $arrIds, $arrFilterUrl, $arrJumpTo, MetaModels\FrontendIntegration\FrontendFilterOptions $objFrontendFilterOptions )
getParameters ( )
getReferencedAttributes ( )
getServiceContainer ( ) : MetaModels\IMetaModelsServiceContainer Retrieve the service container.

Защищенные методы

Метод Описание
addUrlParameter ( string $url, string $name, mixed $value ) : string. Add a parameter to the url, if it is auto_item, it will get prepended.
buildFilterUrl ( array $fragments, string $searchKey ) : string Build the filter url based upon the fragments.
getFrontendFilterValue ( array $arrWidget, array $arrFilterUrl, string $strKeyOption ) : string Translate an option to a proper url value to be used in the filter url.
isActiveFrontendFilterValue ( array $arrWidget, array $arrFilterUrl, string $strKeyOption ) : boolean Returns if the given value is currently active in the given filter settings.
prepareFrontendFilterOptions ( array $arrWidget, array $arrFilterUrl, array $arrJumpTo, boolean $blnAutoSubmit ) : array Generate the options for the frontend widget as the frontend templates expect them.
prepareFrontendFilterWidget ( array $arrWidget, array $arrFilterUrl, array $arrJumpTo, MetaModels\FrontendIntegration\FrontendFilterOptions $objFrontendFilterOptions ) : array Returns the frontend filter widget information for the filter setting.
validateWidget ( Widget $widget, string | null $value ) : void Validate the widget using the value.

Описание методов

__construct() публичный Метод

Constructor - initialize the object and store the parameters.
public __construct ( MetaModels\Filter\Setting\ICollection $collection, array $data )
$collection MetaModels\Filter\Setting\ICollection The parenting filter settings object.
$data array The attributes for this filter setting.

addUrlParameter() защищенный Метод

Add a parameter to the url, if it is auto_item, it will get prepended.
protected addUrlParameter ( string $url, string $name, mixed $value ) : string.
$url string The url built so far.
$name string The parameter name.
$value mixed The parameter value.
Результат string.

buildFilterUrl() защищенный Метод

Build the filter url based upon the fragments.
protected buildFilterUrl ( array $fragments, string $searchKey ) : string
$fragments array The parameters to be used in the Url.
$searchKey string The param key to handle for "this".
Результат string

generateFilterUrlFrom() публичный Метод

public generateFilterUrlFrom ( MetaModels\IItem $objItem, MetaModels\Render\Setting\ICollection $objRenderSetting )
$objItem MetaModels\IItem
$objRenderSetting MetaModels\Render\Setting\ICollection

get() публичный Метод

public get ( $strKey )

getEventDispatcher() публичный Метод

Retrieve the event dispatcher.
public getEventDispatcher ( ) : Symfony\Component\EventDispatcher\EventDispatcherInterface
Результат Symfony\Component\EventDispatcher\EventDispatcherInterface

getFilterSettings() публичный Метод

Get the parenting collection instance.
public getFilterSettings ( ) : MetaModels\Filter\Setting\ICollection
Результат MetaModels\Filter\Setting\ICollection The parent.

getFrontendFilterValue() защищенный Метод

Overriding this method allows to toggle the value in the url in addition to extract or inject a value into an "combined" filter url parameter (like tags i.e.)
protected getFrontendFilterValue ( array $arrWidget, array $arrFilterUrl, string $strKeyOption ) : string
$arrWidget array The widget information.
$arrFilterUrl array The filter url parameters to use.
$strKeyOption string The option value to determine.
Результат string The filter url value to use for link gererating.

getMetaModel() публичный Метод

Return the MetaModel instance this filter setting relates to.
public getMetaModel ( ) : MetaModels\IMetaModel
Результат MetaModels\IMetaModel

getParameterDCA() публичный Метод

public getParameterDCA ( )

getParameterFilterNames() публичный Метод

getParameterFilterWidgets() публичный Метод

public getParameterFilterWidgets ( $arrIds, $arrFilterUrl, $arrJumpTo, MetaModels\FrontendIntegration\FrontendFilterOptions $objFrontendFilterOptions )
$objFrontendFilterOptions MetaModels\FrontendIntegration\FrontendFilterOptions

getParameters() публичный Метод

public getParameters ( )

getReferencedAttributes() публичный Метод

getServiceContainer() публичный Метод

Retrieve the service container.
public getServiceContainer ( ) : MetaModels\IMetaModelsServiceContainer
Результат MetaModels\IMetaModelsServiceContainer

isActiveFrontendFilterValue() защищенный Метод

Returns if the given value is currently active in the given filter settings.
protected isActiveFrontendFilterValue ( array $arrWidget, array $arrFilterUrl, string $strKeyOption ) : boolean
$arrWidget array The widget information.
$arrFilterUrl array The filter url parameters to use.
$strKeyOption string The option value to determine.
Результат boolean true If the given value is mentioned in the given filter parameters, false otherwise.

prepareFrontendFilterOptions() защищенный Метод

The returning array will be made of option arrays containing the following fields: * key The option value as raw key from the options array in the given widget information. * value The value to show as option label. * href The URL to use to activate this value in the filter. * active Boolean determining if this value is the current active option in the widget. * class The CSS class to use. Contains active if the option is active or is empty otherwise.
protected prepareFrontendFilterOptions ( array $arrWidget, array $arrFilterUrl, array $arrJumpTo, boolean $blnAutoSubmit ) : array
$arrWidget array The widget information to use for value generating.
$arrFilterUrl array The filter url parameters to use.
$arrJumpTo array The jumpTo page to use for URL generating - if empty, the current frontend page will get used.
$blnAutoSubmit boolean Determines if the generated options/widgets shall perform auto submitting or not.
Результат array The filter option values to use in the mm_filteritem_* templates.

prepareFrontendFilterWidget() защищенный Метод

The returning array will hold the following keys: * class - The CSS classes for the widget. * label - The label text for the widget. * formfield - The parsed default widget object for this filter setting. * raw - The widget information that was used for rendering "formfield" as raw array (this means prior calling prepareForWidget()). * urlparam - The URL parameter used for this widget. * options - The filter options available to be used in selects etc. see prepareFrontendFilterOptions for details on the contained array. * autosubmit - True if the frontend filter shall perform auto form submitting, false otherwise. * urlvalue - The current value selected in the filtersetting. Will use "urlvalue" from $arrWidget with fallback to the value of the url param in the filter url.
protected prepareFrontendFilterWidget ( array $arrWidget, array $arrFilterUrl, array $arrJumpTo, MetaModels\FrontendIntegration\FrontendFilterOptions $objFrontendFilterOptions ) : array
$arrWidget array The widget information to use for generating.
$arrFilterUrl array The filter url parameters to use.
$arrJumpTo array The jumpTo page to use for URL generating - if empty, the current frontend page will get used.
$objFrontendFilterOptions MetaModels\FrontendIntegration\FrontendFilterOptions The options to use.
Результат array

validateWidget() защищенный Метод

Validate the widget using the value.
protected validateWidget ( Widget $widget, string | null $value ) : void
$widget Contao\Widget The widget to validate.
$value string | null The value to validate.
Результат void