src/forms/HasOneAutocompleteField.php
protected function processResults($results)
    {
        $json = array();
        foreach($results as $result) {
            $name = $result->{$this->labelField};

            $json[$result->ID] = array(
                'name' => $name,
                'currentString' => $this->getCurrentItemText($result)
            );
        }

        return $json;
    }
protected function processResults($results)
    {
        $json = array();
        foreach($results as $result) {
            $name = $result->{$this->labelField};

            $json[$result->ID] = array(
                'name' => $name,
                'currentString' => $this->getCurrentItemText($result)
            );
        }

        return $json;
    }
protected function processResults ( $ results ) { $ json = array ( ) ; foreach ( $ results as $ result ) { $ name = $ result -> { $ this -> labelField } ; $ json [ $ result -> ID ] = array ( 'name' => $ name , 'currentString' => $ this -> getCurrentItemText ( $ result ) ) ; } return $ json ; }
Takes the DataList of search results and returns the json to be sent to the front end.
@param  DataList
@return json
Takes the DataList of search results and returns the json to be sent to the front end .