Skip to content

Commit

Permalink
Add Mnemo_Api::deleteNotepad
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Nov 11, 2013
1 parent e139f42 commit 2bec1a7
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions mnemo/lib/Api.php
Expand Up @@ -516,6 +516,23 @@ public function addNotpad($name, array $params = array())
return $notepad->getName();
}

/**
* Delete notepad.
*
* @param string $id The notepad id.
* @since 4.2.0
*/
public function deleteNotepad($id)
{
// Delete the notepad.
$storage = $GLOBALS['injector']
->getInstance('Mnemo_Factory_Driver')
->create($id);
$storage->deleteAll();
$share = $GLOBALS['mnemo_shares']->getShare($id);
$GLOBALS['mnemo_shares']->removeShare($share);
}

/**
* Update a notepad's title and/or description.
*
Expand Down

0 comments on commit 2bec1a7

Please sign in to comment.