code/LeftAndMain.php
public function getNewItem($id, $setID = true)
    {
        $class = $this->config()->get('tree_class');
        $object = Injector::inst()->create($class);
        if ($setID) {
            $object->ID = $id;
        }
        return $object;
    }
public function getNewItem($id, $setID = true)
    {
        $class = $this->config()->get('tree_class');
        $object = Injector::inst()->create($class);
        if ($setID) {
            $object->ID = $id;
        }
        return $object;
    }
public function getNewItem ( $ id , $ setID = true ) { $ class = $ this -> config ( ) -> get ( 'tree_class' ) ; $ object = Injector :: inst ( ) -> create ( $ class ) ; if ( $ setID ) { $ object -> ID = $ id ; } return $ object ; }
Create new item.

@param string|int $id
@param bool $setID
@return DataObject
Create new item .