public function delete() { // Get all related nodes through the general id $client = $this->getClient(); $label = $client->makeLabel($this->getGeneralId()); $related_nodes = $label->getNodes(); foreach ($related_nodes as $related_node) { // Get and delete all of the relationships $relationships = $related_node->getRelationships(); foreach ($relationships as $relationship) { $relationship->delete(); } $related_node->delete(); } // Delete the main node parent::delete(); }
/** * Create DELETE request to a specified endpoint. * * @param (string) $path API endpoint path. * @param (string) $path_args Endpoint path arguments to replace tokens in the path. * @param (string) $data Raw content of the request or associative array to pass to endpoints. * * @return object Preprocessed structured object and returns 204 No Content on success, with no response body. */ public function delete($path, array $path_args = [], array $data = []) { parent::delete($path, $path_args, $data); $this->setHeaders(['Authorization' => $this->auth()]); $this->unsetHeaders(['Content-Type']); return $this->request($data); }
/** * @override \Podlove\Model\Base::delete(); */ public function delete() { foreach ($this->media_files() as $media_file) { $media_file->delete(); } parent::delete(); }
/** * Deletes self and passes the call to parent class * @see solidbase/lib/Base#delete() */ function delete() { global $USER; if ($this->may($USER, DELETE)) { self::deleteFromMenu(); return parent::delete(); } return false; }
function delete() { global $DB; if ($this->mayI(DELETE)) { $DB->pagelayout->delete($this->ID); $DB->query("UPDATE `pagelayout` SET (`pagelayout`.`place`=`pagelayout`.`place`-1) WHERE `pagelayout`.`place`>'" . $this->place . "' AND `pid`='" . $this->page . "' `row`='" . $this->row . "'"); return parent::delete(); } else { return false; } }