Commit 69ac1175 authored by aaronwinborn's avatar aaronwinborn

* Implement media_metadata_delete() (aaron).

* Rewrite media_metadata_add() to use new dbtng (aaron).
parent 6b4eb5e4
......@@ -4,7 +4,9 @@
August 2009
-----------
* Create media_metadata_add() (aaron).
* Implement media_metadata_delete() (aaron).
* Rewrite media_metadata_add() to use new dbtng (aaron).
* Implement media_metadata_add() (aaron).
July 2009
-------------
......
......@@ -177,14 +177,13 @@ function media_metadata_by_uri($uri, $unhandled = FALSE) {
* Returns the new mid of the key value pair on success, or FALSE on failure.
*/
function media_metadata_add($fid, $name, $data) {
// Create the db record containing the metadata to be saved.
$record = array(
return db_insert('media_metadata')
->fields(array(
'fid' => $fid,
'name' => $name,
'data' => $data,
);
drupal_write_record('media_metadata', $record);
return $record->mid;
))
->execute();
}
/**
......@@ -196,5 +195,7 @@ function media_metadata_add($fid, $name, $data) {
* Returns TRUE on success, or FALSE on failure.
*/
function media_metadata_delete($mid) {
// TODO: Implement
}
\ No newline at end of file
db_delete('media_metadata')
->condition('mid', $mid)
->execute();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment