Source of file AutocompleteExtension.php
Size: 0,808 Bytes - Last Modified: 2022-01-13T10:01:30+00:00
/var/www/docs.ssmods.com/process/src/code/AutocompleteExtension.php
123456789101112131415161718192021222324252627282930313233343536 | <?php /** * AutocompleteExtension * @author Will Morgan <@willmorgan> */ class AutocompleteExtension extends DataExtension { /** * @return array */ public function toAutocompleteArray() { return static::to_autocomplete_array($this->owner); } /** * @param SS_List $scope the scope to iterate over - handy if you don't want * to add this extension for a one-off use * @return array */ public static function to_autocomplete_array($scope) { $items = $scope->toArray(); foreach ($items as &$item) { if ($item->hasMethod('toAutocompleteMap')) { $item = $item->toAutocompleteMap(); } else { $item = $item->toMap(); } } return $items; } } |