本文整理汇总了PHP中Connection::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Connection::delete方法的具体用法?PHP Connection::delete怎么用?PHP Connection::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Connection
的用法示例。
在下文中一共展示了Connection::delete方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
/**
* Deletes a database
*
* This will delete an existing database.
*
* @param Connection $connection - the connection to be used
* @param string $name - the database specification, for example 'myDatabase'
*
* @link http://www.arangodb.com/manuals/1.4/HttpDatabase.html
*
* @return array $responseArray - The response array.
*/
public static function delete(Connection $connection, $name)
{
$url = UrlHelper::buildUrl(Urls::URL_DATABASE, array($name));
$response = $connection->delete($url);
$responseArray = $response->getJson();
return $responseArray;
}
示例2: delete
/**
* Explicitly delete the cursor
*
* This might issue an HTTP DELETE request to inform the server about
* the deletion.
*
* @throws Exception
* @return bool - true if the server acknowledged the deletion request, false otherwise
*/
public function delete()
{
if ($this->_id) {
try {
$this->_connection->delete($this->url() . '/' . $this->_id);
return true;
} catch (Exception $e) {
}
}
return false;
}
示例3: delete
/**
* Explicitly delete the cursor
*
* This might issue an HTTP DELETE request to inform the server about
* the deletion.
*
* @throws Exception
* @return bool - true if the server acknowledged the deletion request, false otherwise
*/
public function delete()
{
if ($this->_id) {
try {
$this->_connection->delete(Urls::URL_CURSOR . '/' . $this->_id);
return true;
} catch (Exception $e) {
}
}
return false;
}
示例4: unregister
/**
* Unregister the user function
*
* If no parameter ($name) is passed, it will use the property of the object.
*
* If $name is passed, it will override the object's property with the passed one
*
* @param string $name
* @param boolean $namespace
*
* @throws Exception throw exception if the request fails
*
* @return mixed true if successful without a return value or the return value if one was set in the action
*/
public function unregister($name = null, $namespace = false)
{
if (is_null($name)) {
$name = $this->getName();
}
$url = UrlHelper::buildUrl(Urls::URL_AQL_USER_FUNCTION, array($name));
if ($namespace) {
$url = UrlHelper::appendParamsUrl($url, array('group' => true));
}
$response = $this->_connection->delete($url);
$responseArray = $response->getJson();
return $responseArray;
}
示例5: deleteConnection
/**
* Delete a connection. Requires login and user must be owner of the connection
*
* @param string $connid
* @return Result or Error
*/
function deleteConnection($connid)
{
$cobj = new Connection($connid);
$result = $cobj->delete();
return $result;
}
示例6: delete
/**
* {@inheritDoc}
*/
public function delete($tableExpression, array $identifier, array $types = array())
{
$tableName = $this->quoteIdentifier($tableExpression);
$identifier = $this->quoteKeys($identifier);
return parent::delete($tableName, $identifier);
}
示例7: delete
/**
* Deletes an endpoint
*
* This will delete an existing endpoint.
*
* @param Connection $connection - the connection to be used
* @param string $endpoint - the endpoint specification, e.g. tcp://127.0.0.1:8530
*
* @link http://www.arangodb.com/manuals/1.4/HttpEndpoint.html
* @return array $responseArray - The response array.
*/
public static function delete(Connection $connection, $endpoint)
{
$url = UrlHelper::buildUrl(Urls::URL_ENDPOINT, array($endpoint));
$response = $connection->delete($url);
$responseArray = $response->getJson();
return $responseArray;
}
示例8: delete
/**
* Delete node
*
* @return Result object (or Error object)
*/
function delete()
{
global $DB, $CFG, $USER, $HUB_FLM, $HUB_SQL;
$this->load();
try {
$this->candelete();
} catch (Exception $e) {
return access_denied_error();
}
$dt = time();
$xml = format_object('xml', $this);
$params = array();
$params[0] = $this->nodeid;
$res = $DB->delete($HUB_SQL->DATAMODEL_NODE_DELETE, $params);
if ($res) {
auditIdea($USER->userid, $this->nodeid, $this->name, $this->description, $CFG->actionDelete, $xml);
// NOT SURE THIS IS REQUIRED NOW AS IT SHOULD HAPPEN ON CASCADE DELETE IN THE DATABASE
// update the related connections (triples)
$params = array();
$params[0] = $this->nodeid;
$params[1] = $this->nodeid;
$resArray = $DB->select($HUB_SQL->DATAMODEL_NODE_DELETE_TRIPLE, $params);
if ($resArray !== false) {
$count = count($resArray);
for ($i = 0; $i < $count; $i++) {
$array = $resArray[$i];
$conn = new Connection($array['TripleID']);
$conn->delete();
}
} else {
return database_error();
}
//update the related URLs
$params = array();
$params[0] = $this->nodeid;
$res3 = $DB->delete($HUB_SQL->DATAMODEL_NODE_DELETE_URLNODE, $params);
if (!$res3) {
return database_error();
}
// Take this opportunity to delete any URLs if they are no longer connected to a node
// Probably should do this in a more organized way!
$params = array();
$res4Array = $DB->select($HUB_SQL->DATAMODEL_NODE_DELETE_URLS_CLEAN, $params);
if ($res4Array !== false) {
$count = count($res4Array);
for ($i = 0; $i < $count; $i++) {
$array = $res4Array[$i];
$url = new URL($array['URLID']);
$url->delete();
}
}
} else {
return database_error();
}
//remove old thumbnail
if ($this->thumb != null && $this->thumb != "" && substr($this->thumb, 0, 7) == 'uploads') {
unlink($HUB_FLM->createUploadsDirPath($this->thumb));
}
return new Result("deleted", "true");
}
示例9: delete
public function delete($tableName, array $identifier)
{
$tableName = $this->quoteIdentifier($tableName);
$identifier = $this->quoteKeys($identifier);
return parent::delete($tableName, $identifier);
}
示例10: kill
/**
* Kills a specific query
*
* This will send an HTTP DELETE command to the server to terminate the specified query
*
* @param string $id - query id
*
* @throws Exception
*
* @return bool
*/
public function kill($id)
{
$url = UrlHelper::buildUrl(Urls::URL_QUERY, array($id));
$this->_connection->delete($url);
return true;
}