mirror of
https://github.com/silverstripe/silverstripe-tagfield
synced 2024-10-22 11:05:32 +02:00
Added getSource() function to populate source inline with the api.
Source isn't populated to the parent because it's transformed directly to an array. Instead we're lazy loading the source when it's requested.
This commit is contained in:
parent
fa754f3fd3
commit
024e648e5a
@ -312,6 +312,21 @@ class TagField extends DropdownField
|
||||
return parent::setValue(array_filter($value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the source array if required
|
||||
*
|
||||
* Note: this is expensive for a SS_List
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getSource()
|
||||
{
|
||||
if (is_null($this->source)) {
|
||||
$this->setSource($this->getSourceList());
|
||||
}
|
||||
return $this->source;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user