src/forms/HasOneAutocompleteField.php
function getItem()
    {
        $sourceObject = $this->sourceObject;
        if ($this->value !== null) {
            $item = $sourceObject::get()->byID($this->value);
        } else {
            $item = $sourceObject::create();
        }
        return $item;
    }
function getItem()
    {
        $sourceObject = $this->sourceObject;
        if ($this->value !== null) {
            $item = $sourceObject::get()->byID($this->value);
        } else {
            $item = $sourceObject::create();
        }
        return $item;
    }
function getItem ( ) { $ sourceObject = $ this -> sourceObject ; if ( $ this -> value !== null ) { $ item = $ sourceObject :: get ( ) -> byID ( $ this -> value ) ; } else { $ item = $ sourceObject :: create ( ) ; } return $ item ; }
Get the currently selected object
@return DataObject
Get the currently selected object