/** * Delete the reference and push the change to the database * * @param string $summary summary for the change * @throws Exception */ public function deleteAndSave($summary = '') { $id = $this->statement->getId(); if ($id === null) { throw new Exception('Statement has no Id. Please save the statement first.'); } if ($this->hash !== null) { $this->statement->getEntity()->getApi()->removeReferences($id, array($this->hash), $this->statement->getEntity()->getLastRevisionId(), $summary); } $this->statement->removeReference($this); }