SilverStripe\TagField\TagField
Provides a tagging interface, storing links between tag DataObjects and a parent DataObject.
Synopsis
class TagField
extends MultiSelectField
{
- // members
- private static array $allowed_actions = ;
- protected bool $shouldLazyLoad = false;
- protected integer $lazyLoadItemLimit = 10;
- protected bool $canCreate = true;
- protected string $titleField = 'Title';
- protected DataList $sourceList;
- protected bool $isMultiple = true;
- protected string $schemaComponent = 'TagField';
- // methods
- public void __construct()
- public bool getShouldLazyLoad()
- public TagField setShouldLazyLoad()
- public int getLazyLoadItemLimit()
- public TagField setLazyLoadItemLimit()
- public bool getIsMultiple()
- public TagField setIsMultiple()
- public bool getCanCreate()
- public TagField setCanCreate()
- public string getTitleField()
- public $this setTitleField()
- public DataList getSourceList()
- public TagField setSourceList()
- public void Field()
- public array getSchemaDataDefaults()
- protected string getSuggestURL()
- protected ArrayList getOptions()
- public void setValue()
- public array getSource()
- public $this setSource()
- public void getAttributes()
- public void saveInto()
- protected DataObject|bool getOrCreateTag()
- public HTTPResponse suggest()
- protected array getTags()
- public bool validate()
- public ReadonlyTagField performReadonlyTransformation()
- public string Type()
- public void getSchemaStateDefaults()
Hierarchy
Extends
- SilverStripe\Forms\MultiSelectField
Members
private
- $allowed_actions — array
protected
- $canCreate — SilverStripe\TagField\bool
- $isMultiple — SilverStripe\TagField\bool
- $lazyLoadItemLimit — int
- $schemaComponent
- $shouldLazyLoad — SilverStripe\TagField\bool
- $sourceList — SilverStripe\ORM\DataList
- $titleField — string
Methods
protected
- getOptions()
- getOrCreateTag() — Get or create tag with the given value
- getSuggestURL()
- getTags() — Returns array of arrays representing tags.
public
- __construct()
- Field() — {@inheritdoc}
- Type() — Prevent the default, which would return "tag"
- getAttributes()
- getCanCreate()
- getIsMultiple()
- getLazyLoadItemLimit()
- getSchemaDataDefaults() — Provide TagField data to the JSON schema for the frontend component
- getSchemaStateDefaults()
- getShouldLazyLoad()
- getSource() — Gets the source array if required
- getSourceList() — Get the DataList source. The 4.x upgrade for SelectField::setSource starts to convert this to an array.
- getTitleField()
- performReadonlyTransformation() — Converts the field to a readonly variant.
- saveInto() — {@inheritdoc}
- setCanCreate()
- setIsMultiple()
- setLazyLoadItemLimit()
- setShouldLazyLoad()
- setSource() — Intercept DataList source
- setSourceList() — Set the model class name for tags
- setTitleField()
- setValue() — {@inheritdoc}
- 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+