SilverStripe\TagField\StringTagField
Provides a tagging interface, storing comma-delimited tags in a DataObject string field.
This is intended bridge the gap between 1.x and 2.x, and when possible TagField should be used
instead.
Synopsis
class StringTagField
extends DropdownField
{
- // members
- private static array $allowed_actions = ;
- protected bool $shouldLazyLoad = false;
- protected integer $lazyLoadItemLimit = 10;
- protected bool $canCreate = true;
- protected null|DataObject $record;
- protected bool $isMultiple = true;
- protected string $schemaComponent = 'TagField';
- // methods
- public bool getShouldLazyLoad()
- public $this setShouldLazyLoad()
- public int getLazyLoadItemLimit()
- public $this setLazyLoadItemLimit()
- public bool getIsMultiple()
- public $this setIsMultiple()
- public null|DataObject getRecord()
- public $this setRecord()
- public void Field()
- public array getSchemaDataDefaults()
- protected void formatOptions()
- public array getAttributes()
- protected string getSuggestURL()
- protected ArrayList getOptions()
- public void setValue()
- public void saveInto()
- public mixed|string dataValue()
- public HTTPResponse suggest()
- protected array getTags()
- public bool validate()
- public bool getCanCreate()
- public $this setCanCreate()
Hierarchy
Extends
- SilverStripe\Forms\DropdownField
Tasks
Line | Task |
---|---|
328 | do we actually need lazy loading limits for StringTagField? |
Members
private
- $allowed_actions — array
protected
- $canCreate — SilverStripe\TagField\bool
- $isMultiple — SilverStripe\TagField\bool
- $lazyLoadItemLimit — int
- $record — SilverStripe\TagField\null|DataObject
- $schemaComponent
- $shouldLazyLoad — SilverStripe\TagField\bool
Methods
protected
- formatOptions()
- getOptions()
- getSuggestURL()
- getTags() — Returns array of arrays representing tags that partially match the given search term
public
- Field()
- dataValue() — Ensure that arrays are imploded before being saved
- getAttributes() — When not used in a React form factory context, this adds the schema data to SilverStripe template rendered attributes lists
- getCanCreate()
- getIsMultiple()
- getLazyLoadItemLimit()
- getRecord()
- getSchemaDataDefaults() — Provide TagField data to the JSON schema for the frontend component
- getShouldLazyLoad()
- saveInto()
- setCanCreate()
- setIsMultiple()
- setLazyLoadItemLimit()
- setRecord()
- setShouldLazyLoad()
- setValue()
- suggest() — Returns a JSON string of tags, for lazy loading.
- validate() — DropdownField assumes value will be a scalar so we must override validate. This only applies to Silverstripe 3.2+