Properties

$maxLifeTime

$maxLifeTime : integer

Maximum cache lifetime for this filter in seconds.

Type

integer

$items

$items : array

Container for filtering results.

Type

array

$countryNames

$countryNames : array

Cached array of country names.

Type

array

$name

$name : string

Internal name of this filter.

Type

string

Methods

__construct()

__construct(string  $name = 'Country', integer|null  $maxLifeTime = null) 

Country constructor.

Parameters

string $name

internal name

integer|null $maxLifeTime

maximum lifetime of cache files in seconds

__destruct()

__destruct() 

AbstractFilter destructor.

build()

build(\OpenEstate\PhpExport\Environment  $env) : boolean

Create an array of object ID's, that are matched by this filter.

Parameters

\OpenEstate\PhpExport\Environment $env

export environment

Returns

boolean —

true, if the data was successfully loaded

getFile()

getFile(\OpenEstate\PhpExport\Environment  $env) : string

Get the path to the cache file for this filter.

Parameters

\OpenEstate\PhpExport\Environment $env

export environment

Returns

string —

absolute path to the cache file

getItems()

getItems(string  $value) : array

Get the array of object ID's, that match with the filter for a certain value.

Parameters

string $value

filter value

Returns

array —

array of object ID's, that match with the provided filter value

getName()

getName() : string

Get the internal filter name.

Returns

string —

filter name

getTitle()

getTitle(string  $lang) : string

Get the filter title for the current language.

Parameters

string $lang

current language code

Returns

string —

title

getWidget()

getWidget(\OpenEstate\PhpExport\Environment  $env, string  $selectedValue = null) : \OpenEstate\PhpExport\Html\AbstractInputElement|null

Create a HTML widget for a selection on this filter.

Parameters

\OpenEstate\PhpExport\Environment $env

export environment

string $selectedValue

selected filter value

Returns

\OpenEstate\PhpExport\Html\AbstractInputElement|null —

created HTML widget or null, if it can't be created

read()

read(\OpenEstate\PhpExport\Environment  $env) : boolean

Load array with filter values from cache file.

Parameters

\OpenEstate\PhpExport\Environment $env

export environment

Returns

boolean —

true, if the cache file was loaded, otherwise false

readOrRebuild()

readOrRebuild(\OpenEstate\PhpExport\Environment  $env) : boolean

Load array with filter values from cache file.

If no valid cache file is available, load the data from available objects.

Parameters

\OpenEstate\PhpExport\Environment $env

export environment

Returns

boolean —

true, if the filter values were loaded, otherwise false

write()

write(\OpenEstate\PhpExport\Environment  $env) 

Write filter values into the cache file.

Parameters

\OpenEstate\PhpExport\Environment $env

export environment

filter()

filter(array  $object, array  $items) : void

Determine, if an object is matched by the filter.

The ID of a matching object is added to $items.

Parameters

array $object

array with object data

array $items

array with filtered items