PHP 클래스 MetaModels\Filter\Setting\Simple

상속: implements MetaModels\Filter\Setting\ISimple
파일 보기 프로젝트 열기: metamodels/core

공개 메소드들

메소드 설명
__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