code/LeftAndMain.php
public function getRecord($id)
    {
        $className = $this->config()->get('tree_class');
        if (!$className) {
            return null;
        }
        if ($id instanceof $className) {
            return $id;
        }
        if ($id === 'root') {
            return DataObject::singleton($className);
        }
        if (is_numeric($id)) {
            return DataObject::get_by_id($className, $id);
        }
        return null;
    }
public function getRecord($id)
    {
        $className = $this->config()->get('tree_class');
        if (!$className) {
            return null;
        }
        if ($id instanceof $className) {
            return $id;
        }
        if ($id === 'root') {
            return DataObject::singleton($className);
        }
        if (is_numeric($id)) {
            return DataObject::get_by_id($className, $id);
        }
        return null;
    }
public function getRecord ( $ id ) { $ className = $ this -> config ( ) -> get ( 'tree_class' ) ; if ( ! $ className ) { return null ; } if ( $ id instanceof $ className ) { return $ id ; } if ( $ id === 'root' ) { return DataObject :: singleton ( $ className ) ; } if ( is_numeric ( $ id ) ) { return DataObject :: get_by_id ( $ className , $ id ) ; } return null ; }
Get dataobject from the current ID

@param int|DataObject $id ID or object
@return DataObject
Get dataobject from the current ID