/** * Convinence function that gets the document id (handle) from models, vertex pods and strings. * @param Document|AModel|string $model * @throws GraphManagerException */ protected function getVertexId($model) { if ($model instanceof AModel) { return $model->getPod()->getId(); } elseif ($model instanceof Document) { return $model->getId(); } elseif (is_string($model)) { return $model; } else { throw new GraphManagerException('$model can be either a model, a vertex pod or the id of the vertex.'); } }