/** * Get info for the current graph * * @return array */ public function getInfo() { $response = $this->makeRequest('GET'); return Factory::getGeneric($this, $response); }
/** * Performs a PUT request to a custom endpoint with payload $data * * @param string $url * @param array $data * @throws \InvalidArgumentException * @throws \RuntimeException * @return Ambigous <boolean, \Rexster\Object> */ public function putCustom($url, array $data = array()) { if (empty($url)) { throw new \InvalidArgumentException('Invalid URL'); } $response = $this->makeRequest('PUT', "/{$url}", $data); if (!$response) { throw new \RuntimeException($this->getLastErrorMessage()); } return Factory::getGeneric($this, $response); }
public function getBothDirectionVertexIds() { if (empty($this->id)) { throw new \InvalidArgumentException("Invalid vertex id"); } $response = $this->getClient()->makeRequest('GET', $this->getPath() . '/' . $this->getId() . '/bothIds'); return Factory::getGeneric($this->getClient(), $response); }
public function delete(array $properties = array()) { if (empty($this->id)) { throw new \InvalidArgumentException('Invalid object id to update'); } if ($this->id != $this->_id) { throw new \InvalidArgumentException("Node ID's do not match? this->_id = {$this->_id} -- this->id = {$this->id}"); } $url = '/' . $this->getPath() . '/' . $this->getId(); if (!empty($properties)) { $tmp = array(); foreach ($properties as $property) { $tmp[$property] = $property; } unset($properties); $properties = $tmp; } $response = $this->getClient()->makeRequest("DELETE", $url, $properties); return Factory::getGeneric($this->getClient(), $response); }