Mnemo::getMemo PHP Method

getMemo() public static method

Retrieves a specific note from storage.
public static getMemo ( string $notepad, string $noteId, string $passphrase = null ) : array
$notepad string The notepad to retrieve the note from.
$noteId string The Id of the note to retrieve.
$passphrase string A passphrase with which this note was supposed to be encrypted.
return array The note.
    public static function getMemo($notepad, $noteId, $passphrase = null)
    {
        $storage = $GLOBALS['injector']->getInstance('Mnemo_Factory_Driver')->create($notepad);
        return $storage->get($noteId, $passphrase);
    }

Usage Example

コード例 #1
0
ファイル: memo.php プロジェクト: horde/horde
         }
         /* Check our results. */
         if (!empty($haveError)) {
             $notification->push(sprintf(_("There was an error saving the note: %s"), $haveError), 'horde.warning');
         } else {
             $notification->push(sprintf(_("Successfully saved \"%s\"."), $memo_desc), 'horde.success');
         }
     }
     /* Return to the notepad view. */
     if (!Horde_Util::getFormData('save_only')) {
         Horde::url('list.php', true)->redirect();
     }
     break;
 case 'delete_memos':
     /* Delete the note if we're provided with a valid note ID. */
     if (!is_null($memo_id) && Mnemo::getMemo($memolist_id, $memo_id)) {
         if (getShare($memolist_id)->hasPermission($user, Horde_Perms::DELETE)) {
             $storage = $injector->getInstance('Mnemo_Factory_Driver')->create($memolist_id);
             try {
                 $storage->delete($memo_id);
                 $notification->push(_("The note was deleted."), 'horde.success');
             } catch (Mnemo_Exception $e) {
                 $notification->push(sprintf(_("There was an error removing the note: %s"), $e->getMessage()), 'horde.warning');
             }
         } else {
             $notification->push(_("Access denied deleting note."), 'horde.warning');
         }
     }
     /* Return to the notepad. */
     Horde::url('list.php', true)->redirect();
 default:
All Usage Examples Of Mnemo::getMemo