class DataObjectQueryFilter implements ConfigurationApplier (View source)

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

$this setChainableParent(DataObjectScaffolder|SchemaScaffolder $parent)

Set parent

Parameters

DataObjectScaffolder|SchemaScaffolder $parent

Return Value

$this

string getDataObjectClass()

Return Value

string

DataObject getDataObjectInstance()

Return Value

DataObject

$this setDataObjectClass(string $class)

Sets the DataObject name

Parameters

string $class

Return Value

$this

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

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

__construct(string $dataObjectClass)

DataObjectQueryFilter constructor.

Parameters

string $dataObjectClass

$this setFilterRegistry(FilterRegistryInterface $registry)

Parameters

FilterRegistryInterface $registry

Return Value

$this

string getFilterKey()

Return Value

string

DataObjectQueryFilter setFilterKey(string $filterKey)

Parameters

string $filterKey

Return Value

DataObjectQueryFilter

string getExcludeKey()

Return Value

string

DataObjectQueryFilter setExcludeKey(string $excludeKey)

Parameters

string $excludeKey

Return Value

DataObjectQueryFilter

bool exists()

Return Value

bool

$this addFieldFilterByIdentifier($fieldName, $filterIdentifier)

Parameters

$fieldName
$filterIdentifier

Return Value

$this

addFieldFilter($fieldName, FieldFilterInterface $filter)

Parameters

$fieldName
FieldFilterInterface $filter

$this addDefaultFilters(string $field)

Parameters

string $field

Return Value

$this

$this addAllFilters()

Adds all the default filters for every field on the dataobject

Return Value

$this

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

Parameters

string $name
bool $cached

Return Value

InputObjectType

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

Parameters

DataList $list
array $args

Return Value

DataList

array getFiltersForField(string $fieldName)

Parameters

string $fieldName

Return Value

array

Exceptions

InvalidArgumentException

array getFilterIdentifiersForField(string $fieldName)

Parameters

string $fieldName

Return Value

array

Exceptions

InvalidArgumentException

bool isFieldFiltered(string $fieldName)

Parameters

string $fieldName

Return Value

bool

bool fieldHasFilter(string $fieldName, string $id)

Parameters

string $fieldName
string $id

Return Value

bool

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

Parameters

string $fieldName
string $id

Return Value

$this

FieldFilterInterface|null getFieldFilterByIdentifier($fieldName, $id)

Parameters

$fieldName
$id

Return Value

FieldFilterInterface|null

applyConfig(array $config)

Parameters

array $config