Paradox/toolbox/PodManager.php
private function setupModel(Document $pod)
    {
        $name = $this->_toolbox->formatModel($pod);

        $model = new $name();

        if (!($model instanceof AModel)) {
            throw new PodManagerException("Custom models must inherit from the Paradox Model class.");
        }

        $model->loadPod($pod);

        $pod->loadModel($model);

        return $model;
    }
private function setupModel(Document $pod)
    {
        $name = $this->_toolbox->formatModel($pod);

        $model = new $name();

        if (!($model instanceof AModel)) {
            throw new PodManagerException("Custom models must inherit from the Paradox Model class.");
        }

        $model->loadPod($pod);

        $pod->loadModel($model);

        return $model;
    }
Convinence function that sets up the model for a pod and associates the model with it.
@param  Document            $pod The pod we want to set up the model for.
@throws PodManagerException
@return AModel