Paradox/toolbox/PodManager.php
public function dispense($type, $label = null)
    {
        if ($label !== null && (!$this->_toolbox->isGraph() || ($this->_toolbox->isGraph() && strtolower($type) != "edge"))) {
            throw new PodManagerException("Only Edge pods can have a label passed into dispense().");
        }

        //Graph pods
        if ($this->_toolbox->isGraph()) {

            switch (strtolower($type)) {

                case "vertex":
                    $model = $this->createVertex();
                    break;

                case "edge":
                    $model = $this->createEdge();

                    if ($label) {
                        $model->set('$label', $label);
                    }

                    break;

                default:
                    throw new PodManagerException("When dispensing pods for graphs, only the types 'vertex' and 'edge' are allowed. You provided '$type'.");
            }

        //Document pods
        } else {
            $model = $this->createDocument($type);
        }

        //Signal here
        $this->notify("after_dispense", $model->getPod());

        return $model;
    }
public function dispense($type, $label = null)
    {
        if ($label !== null && (!$this->_toolbox->isGraph() || ($this->_toolbox->isGraph() && strtolower($type) != "edge"))) {
            throw new PodManagerException("Only Edge pods can have a label passed into dispense().");
        }

        //Graph pods
        if ($this->_toolbox->isGraph()) {

            switch (strtolower($type)) {

                case "vertex":
                    $model = $this->createVertex();
                    break;

                case "edge":
                    $model = $this->createEdge();

                    if ($label) {
                        $model->set('$label', $label);
                    }

                    break;

                default:
                    throw new PodManagerException("When dispensing pods for graphs, only the types 'vertex' and 'edge' are allowed. You provided '$type'.");
            }

        //Document pods
        } else {
            $model = $this->createDocument($type);
        }

        //Signal here
        $this->notify("after_dispense", $model->getPod());

        return $model;
    }
Sets up a pod enclosed in a model.
@param  string $collection The type of pod you want to dispense. For graphs, only "vertex" and "edge" is allowed. For documents, the name of the collection.
@param  string $label      If you are dispensing an edge, you can optionally provide a label for that edge.
@return AModel