Paradox/toolbox/PodManager.php
private function createDocument($type, $data = array(), $new = true)
    {
        $document = new Document($this->_toolbox, $type, $data, $new);
        $this->attachEventsToPod($document);

        return $this->setupModel($document, $document);
    }
private function createDocument($type, $data = array(), $new = true)
    {
        $document = new Document($this->_toolbox, $type, $data, $new);
        $this->attachEventsToPod($document);

        return $this->setupModel($document, $document);
    }
Convinence function to instantiate a document, hook up its events and set up its model.
@param array  $data An optional array of data that will be loaded into the document.
@param string $new  Whether this pod should be marked as new (never saved to the server).