interface AttributeInterface (View source)

Methods

__construct(EntityManager $entityManager)

AttributeInterface constructor.

getAttributeValue()

Get Attribute Value object.

mixed
getDisplayValue()

For a DateTime implementation this could for example mean that the value is formatted and localized.

getAttributeType()

Returns a Type entity.

setAttributeType(Type $type)

No description

getAttributeKey()

Returns a Key entity.

mixed
setAttributeKey($key)

No description

getIconFormatter()

Return a formatter object that provides an icon that will be shown in the list of attributes.

saveKey(array $data)

This method is called any time an attribute key is created or updated.

string|int
getSearchIndexValue()

This value will be used by the search index.

createAttributeValueFromRequest()

Is run when an attribute is saved through the standard user interfaces like the sitemap attributes dialog, the attributes panel, or the user attributes slideouts.

createAttributeValue($mixed)

Is run whenever $object->setAttribute('my_property_location_attribute', $value) is run through code, with whatever you happen to pass through.

string
getAttributeValueClass()

Is used to determine the name of the entity used to store the attribute value.

Details

__construct(EntityManager $entityManager)

AttributeInterface constructor.

Parameters

EntityManager $entityManager

AttributeValueInterface getAttributeValue()

Get Attribute Value object.

mixed getDisplayValue()

For a DateTime implementation this could for example mean that the value is formatted and localized.

Return Value

mixed

Type getAttributeType()

Returns a Type entity.

The Type object is mapped with a row from the AttributeTypes table. Use the object for example to retrieve the current attribute type handle (e.g. 'date_time').

Return Value

Type

setAttributeType(Type $type)

No description

Parameters

Type $type

AttributeKeyInterface|Key getAttributeKey()

Returns a Key entity.

A key is mapped with a row from the AttributeKeys table. Use the object for example to retrieve the current attribute handle (e.g. 'meta_title').

Return Value

AttributeKeyInterface|Key

mixed setAttributeKey($key)

No description

Parameters

$key AttributeKeyInterface

Return Value

mixed

IconFormatterInterface getIconFormatter()

Return a formatter object that provides an icon that will be shown in the list of attributes.

Example implementation: return new FontAwesomeIconFormatter('check-square');

Return Value

IconFormatterInterface

saveKey(array $data)

This method is called any time an attribute key is created or updated.

$data is simply the POST values from the form.

Parameters

array $data

string|int getSearchIndexValue()

This value will be used by the search index.

Return Value

string|int

AttributeValueInterface createAttributeValueFromRequest()

Is run when an attribute is saved through the standard user interfaces like the sitemap attributes dialog, the attributes panel, or the user attributes slideouts.

AttributeValueInterface createAttributeValue($mixed)

Is run whenever $object->setAttribute('my_property_location_attribute', $value) is run through code, with whatever you happen to pass through.

Parameters

$mixed

Return Value

AttributeValueInterface

string getAttributeValueClass()

Is used to determine the name of the entity used to store the attribute value.

You can reuse this throughout your controllers, but it's used by the getAttributeValueObject() method in the base controller to retrieve the relevant attribute data value object.

Return Value

string