Paradox/toolbox/PodManager.php
private function generateCreateEdgeCommand($fromKeyIsJSVar, $fromKey, $toKeyIsJSVar, $toKey, $data, $id = null, $idIsVariable = false, $label = null)
    {
        $command = "graph.addEdge(";

        if ($fromKeyIsJSVar) {
            $command .= "graph.getVertex(result.$fromKey._id)";
        } else {
            $command .= "graph.getVertex('$fromKey')";
        }

        $command .= ", ";

        if ($toKeyIsJSVar) {
            $command .= "graph.getVertex(result.$toKey._id)";
        } else {
            $command .= "graph.getVertex('$toKey')";
        }

        $command .= ", ";

        if ($id) {

            if ($idIsVariable) {
                $command .= "$id";
            } else {
                $command .= "'$id'";
            }

        } else {
            $command .= "null";
        }

        if ($label) {
            $command .= ", '$label'";
        }

        $command .= ", $data)._properties;";

        return $command;
    }
private function generateCreateEdgeCommand($fromKeyIsJSVar, $fromKey, $toKeyIsJSVar, $toKey, $data, $id = null, $idIsVariable = false, $label = null)
    {
        $command = "graph.addEdge(";

        if ($fromKeyIsJSVar) {
            $command .= "graph.getVertex(result.$fromKey._id)";
        } else {
            $command .= "graph.getVertex('$fromKey')";
        }

        $command .= ", ";

        if ($toKeyIsJSVar) {
            $command .= "graph.getVertex(result.$toKey._id)";
        } else {
            $command .= "graph.getVertex('$toKey')";
        }

        $command .= ", ";

        if ($id) {

            if ($idIsVariable) {
                $command .= "$id";
            } else {
                $command .= "'$id'";
            }

        } else {
            $command .= "null";
        }

        if ($label) {
            $command .= ", '$label'";
        }

        $command .= ", $data)._properties;";

        return $command;
    }
Generates the javascript command to create an edge (for use with transactions).
@param  boolean $fromKeyIsJSVar Whether the from key is a javascript variable name or not.
@param  string  $fromKey        The id of the from vertex.
@param  boolean $toKeyIsJSVar   Whether the to key is a javascript variable name or not.
@param  string  $toKey          The id of the to vertex.
@param  string  $data           JSON representation of the edge data.
@param  string  $id             An optional id for the edge.
@param  boolean $idIsVariable   Whether the id string is a javascript variable.
@param  string  $label          The optional label of the edge
@return string