/** * Function: isReference * * Returns true if the given fieldname is to be treated * as a textual reference (ID). This implementation returns * true if the given fieldname is in <idrefs>. * * Parameters: * * obj - Object instance that contains the field. * attr - Fieldname of the field. * value - Value of the field. * write - Boolean indicating if the field is being encoded or decoded. * Write is true if the field is being encoded, else it is being decoded. */ function isReference($obj, $attr, $value, $write) { return mxUtils::indexOf($this->idrefs, $attr) >= 0; }
/** * Function: insertEdge * * Inserts the specified edge into the edge array and returns the edge. * Will update the respective terminal reference of the edge. * * Parameters: * * edge - <mxCell> to be inserted into the edge array. * outgoing - Boolean that specifies if the edge is outgoing. */ function insertEdge($edge, $outgoing) { if (isset($edge)) { $edge->removeFromTerminal($outgoing); $edge->setTerminal($this, $outgoing); if ($this->edges == null || $edge->getTerminal(!$outgoing) !== $this || mxUtils::indexOf($this->edges, $edge) < 0) { if ($this->edges == null) { $this->edges = array(); } array_push($this->edges, $edge); } } return $edge; }