/** * A basic test that will be called and fail. */ public function testDeleteByID() { $db_prefix = elgg_get_config('dbprefix'); $annotations = $this->createAnnotations(1); $metadata = $this->createMetadata(1); foreach ($this->metastringTypes as $type) { $id = ${$type}[0]; $table = $db_prefix . $type; $q = "SELECT * FROM {$table} WHERE id = {$id}"; $test = get_data($q); $this->assertEqual($test[0]->id, $id); $this->assertTrue(elgg_delete_metastring_based_object_by_id($id, $type)); $this->assertFalse(get_data($q)); } }
/** * Delete the metadata * * @return bool */ function delete() { return elgg_delete_metastring_based_object_by_id($this->id, 'metadata'); }
/** * Delete the annotation. * * @return bool */ function delete() { remove_from_river_by_annotation($this->id); return elgg_delete_metastring_based_object_by_id($this->id, 'annotations'); }
/** * Delete the annotation. * * @return bool */ function delete() { elgg_delete_river(array('annotation_id' => $this->id)); return elgg_delete_metastring_based_object_by_id($this->id, 'annotations'); }
/** * Delete the metadata * * @return bool */ function delete() { $success = elgg_delete_metastring_based_object_by_id($this->id, 'metadata'); if ($success) { // we mark unknown here because this deletes only one value // under this name, and there may be others remaining. elgg_get_metadata_cache()->markUnknown($this->entity_guid, $this->name); } return $success; }