class DataObjectQueryFilter implements ConfigurationApplier

Traits

Offers a few helper methods for classes that are DataObject subclass bound.
A class that can be instantiated or replaced via DI

Constants

SEPARATOR

Methods

string
getDataObjectClass()

No description

$this
setDataObjectClass(string $class)

Sets the DataObject name

static Injectable
create(array $args)

An implementation of the factory method, allows you to create an instance of a class

static Injectable
singleton(string $class = null)

Creates a class instance by the "singleton" design pattern.

__construct(string $dataObjectClass)

DataObjectQueryFilter constructor.

$this
setFilterRegistry(FilterRegistryInterface $registry)

No description

string
getFilterKey()

No description

setFilterKey(string $filterKey)

No description

string
getExcludeKey()

No description

setExcludeKey(string $excludeKey)

No description

bool
exists()

No description

$this
addFieldFilterByIdentifier($fieldName, $filterIdentifier)

No description

addFieldFilter($fieldName, FieldFilterInterface $filter)

No description

$this
addDefaultFilters(string $field)

No description

$this
addAllFilters()

Adds all the default filters for every field on the dataobject

InputObjectType
getInputType(string $name, bool $cached = true)

No description

applyArgsToList(DataList $list, array $args = [])

No description

array
getFiltersForField(string $fieldName)

No description

array
getFilterIdentifiersForField(string $fieldName)

No description

bool
isFieldFiltered(string $fieldName)

No description

bool
fieldHasFilter(string $fieldName, string $id)

No description

$this
removeFieldFilterByIdentifier(string $fieldName, string $id)

No description

getFieldFilterByIdentifier($fieldName, $id)

No description

applyConfig(array $config)

No description

Details

in Chainable at line 21
$this setChainableParent(DataObjectScaffolder|SchemaScaffolder $parent)

Set parent

Parameters

DataObjectScaffolder|SchemaScaffolder $parent

Return Value

$this

in DataObjectTypeTrait at line 29
string getDataObjectClass()

Return Value

string

in DataObjectTypeTrait at line 52
DataObject getDataObjectInstance()

Return Value

DataObject

in DataObjectTypeTrait at line 65
$this setDataObjectClass(string $class)

Sets the DataObject name

Parameters

string $class

Return Value

$this

in Injectable at line 26
static Injectable create(array $args)

An implementation of the factory method, allows you to create an instance of a class

This method will defer class substitution to the Injector API, which can be customised via the Config API to declare substitution classes.

This can be called in one of two ways - either calling via the class directly, or calling on Object and passing the class name as the first parameter. The following are equivalent: $list = DataList::create('SiteTree'); $list = SiteTree::get();

Parameters

array $args

Return Value

Injectable

in Injectable at line 43
static Injectable singleton(string $class = null)

Creates a class instance by the "singleton" design pattern.

It will always return the same instance for this class, which can be used for performance reasons and as a simple way to access instance methods which don't rely on instance data (e.g. the custom SilverStripe static handling).

Parameters

string $class Optional classname to create, if the called class should not be used

Return Value

Injectable The singleton instance

at line 57
__construct(string $dataObjectClass)

DataObjectQueryFilter constructor.

Parameters

string $dataObjectClass

at line 66
$this setFilterRegistry(FilterRegistryInterface $registry)

Parameters

FilterRegistryInterface $registry

Return Value

$this

at line 76
FilterRegistryInterface getFilterRegistry()

at line 84
string getFilterKey()

Return Value

string

at line 93
DataObjectQueryFilter setFilterKey(string $filterKey)

Parameters

string $filterKey

Return Value

DataObjectQueryFilter

at line 102
string getExcludeKey()

Return Value

string

at line 111
DataObjectQueryFilter setExcludeKey(string $excludeKey)

Parameters

string $excludeKey

Return Value

DataObjectQueryFilter

at line 120
bool exists()

Return Value

bool

at line 130
$this addFieldFilterByIdentifier($fieldName, $filterIdentifier)

Parameters

$fieldName
$filterIdentifier

Return Value

$this

at line 145
addFieldFilter($fieldName, FieldFilterInterface $filter)

Parameters

$fieldName
FieldFilterInterface $filter

at line 160
$this addDefaultFilters(string $field)

Parameters

string $field

Return Value

$this

at line 181
$this addAllFilters()

Adds all the default filters for every field on the dataobject

Return Value

$this

at line 196
InputObjectType getInputType(string $name, bool $cached = true)

Parameters

string $name
bool $cached

Return Value

InputObjectType

at line 248
DataList applyArgsToList(DataList $list, array $args = [])

Parameters

DataList $list
array $args

Return Value

DataList

at line 273
array getFiltersForField(string $fieldName)

Parameters

string $fieldName

Return Value

array

Exceptions

InvalidArgumentException

at line 290
array getFilterIdentifiersForField(string $fieldName)

Parameters

string $fieldName

Return Value

array

Exceptions

InvalidArgumentException

at line 300
bool isFieldFiltered(string $fieldName)

Parameters

string $fieldName

Return Value

bool

at line 316
bool fieldHasFilter(string $fieldName, string $id)

Parameters

string $fieldName
string $id

Return Value

bool

at line 330
$this removeFieldFilterByIdentifier(string $fieldName, string $id)

Parameters

string $fieldName
string $id

Return Value

$this

at line 344
FieldFilterInterface|null getFieldFilterByIdentifier($fieldName, $id)

Parameters

$fieldName
$id

Return Value

FieldFilterInterface|null

at line 354
applyConfig(array $config)

Parameters

array $config