PHP Class Mnemo_Driver, horde

Copyright 2001-2016 Horde LLC (http://www.horde.org/) See the enclosed file LICENSE for license information (ASL). If you did not receive this file, see http://www.horde.org/licenses/apache.
Author: Jon Parise ([email protected])
Author: Michael J. Rubinsky ([email protected])
显示文件 Open project: horde/horde

Protected Properties

Property Type Description
$_memos array Array holding the current memo list. Each array entry is a hash describing a memo. The array is indexed numerically by memo ID.
$_notepad string String containing the current notepad name.
$_pgp Horde_Crypt_pgp Crypting processor.

Public Methods

Method Description
add ( string $desc, string $body, string $tags = '', string $passphrase = null ) : string Adds a note to the backend storage.
delete ( string $noteId ) Deletes a note permanently.
deleteAll ( ) Deletes all notes from the current notepad.
encryptionSupported ( ) : boolean Returns whether note encryption is supported.
fromiCalendar ( Horde_Icalendar_Vnote $vNote ) : array Create a memo (hash array) from a Horde_Icalendar_Vnote object.
get ( string $noteId, string $passphrase = null ) : array Retrieves one note from the backend.
getByUID ( string $uid, string $passphrase = null ) : array Retrieves one note from the backend by UID.
getMemoDescription ( $body ) Update the description (short summary) of a memo.
listMemos ( ) : array Lists memos based on the given criteria. All memos will be returned by default.
modify ( string $noteId, string $desc, string $body, string $tags = '', string $passphrase = null ) Modifies an existing note.
move ( string $noteId, string $newNotepad ) Moves a note to a new notepad.
retrieve ( ) Retrieves all of the notes of the current notepad from the backend.
synchronize ( mixed $token = false ) Perform any synchronization with backend data handlers that may be necessary for the driver.
toASNote ( array $memo, array $options = [] ) : Horde_ActiveSync_Message_Note Create an AS memo from this task
toiCalendar ( $memo, $calendar ) : Horde_Icalendar_Vnote Export this memo in iCalendar format.

Protected Methods

Method Description
_add ( string $noteId, string $desc, string $body, string $tags ) : string Adds a note to the backend storage.
_decrypt ( string $note, string $passphrase ) : string Decrypts a note.
_delete ( $noteId ) : string Deletes a note permanently.
_deleteAll ( ) : array Deletes all notes from the current notepad.
_encrypt ( string $note, string $passphrase ) : string Encrypts a note.
_generateId ( ) : string Generates a local note ID.
_loadPGP ( ) Loads the PGP encryption driver.
_modify ( string $noteId, string $desc, string $body, string $tags ) : string Modifies an existing note.
_move ( string $noteId, string $newNotepad ) : string Moves a note to a new notepad.

Method Details

_add() abstract protected method

Adds a note to the backend storage.
abstract protected _add ( string $noteId, string $desc, string $body, string $tags ) : string
$noteId string The ID of the new note.
$desc string The first line of the note.
$body string The whole note body.
$tags string The tags of the note.
return string The unique ID of the new note.

_decrypt() protected method

Decrypts a note.
protected _decrypt ( string $note, string $passphrase ) : string
$note string The encrypted note text.
$passphrase string The passphrase to decrypt the note with.
return string The decrypted text.

_delete() abstract protected method

Deletes a note permanently.
abstract protected _delete ( $noteId ) : string
return string The note's UID.

_deleteAll() abstract protected method

Deletes all notes from the current notepad.
abstract protected _deleteAll ( ) : array
return array An array of uids that have been removed.

_encrypt() protected method

Encrypts a note.
protected _encrypt ( string $note, string $passphrase ) : string
$note string The note text.
$passphrase string The passphrase to encrypt the note with.
return string The encrypted text.

_generateId() abstract protected method

Generates a local note ID.
abstract protected _generateId ( ) : string
return string A new note ID.

_loadPGP() protected method

Loads the PGP encryption driver.
protected _loadPGP ( )

_modify() abstract protected method

Modifies an existing note.
abstract protected _modify ( string $noteId, string $desc, string $body, string $tags ) : string
$noteId string The note to modify.
$desc string The first line of the note.
$body string The whole note body.
$tags string The tags of the note.
return string The note's UID.

_move() abstract protected method

Moves a note to a new notepad.
abstract protected _move ( string $noteId, string $newNotepad ) : string
$noteId string The note to move.
$newNotepad string The new notepad.
return string The note's UID.

add() public method

Adds a note to the backend storage.
public add ( string $desc, string $body, string $tags = '', string $passphrase = null ) : string
$desc string The first line of the note.
$body string The whole note body.
$tags string The tags of the note.
$passphrase string The passphrase to encrypt the note with.
return string The ID of the new note.

delete() public method

Deletes a note permanently.
public delete ( string $noteId )
$noteId string The note to delete.

deleteAll() public method

Deletes all notes from the current notepad.
public deleteAll ( )

encryptionSupported() public method

Checks if PGP support could be loaded, if it supports symmetric encryption, and if we have a secure connection.
public encryptionSupported ( ) : boolean
return boolean Whether encryption is suppoted.

fromiCalendar() public method

Create a memo (hash array) from a Horde_Icalendar_Vnote object.
public fromiCalendar ( Horde_Icalendar_Vnote $vNote ) : array
$vNote Horde_Icalendar_Vnote
return array Memo (hash array) created from the vNote.

get() abstract public method

Retrieves one note from the backend.
abstract public get ( string $noteId, string $passphrase = null ) : array
$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 array of note attributes.

getByUID() abstract public method

Retrieves one note from the backend by UID.
abstract public getByUID ( string $uid, string $passphrase = null ) : array
$uid string The UID of the note to retrieve.
$passphrase string A passphrase with which this note was supposed to be encrypted.
return array The array of note attributes.

getMemoDescription() public method

Update the description (short summary) of a memo.
public getMemoDescription ( $body )

listMemos() public method

Lists memos based on the given criteria. All memos will be returned by default.
public listMemos ( ) : array
return array Returns a list of the requested memos.

modify() public method

Modifies an existing note.
public modify ( string $noteId, string $desc, string $body, string $tags = '', string $passphrase = null )
$noteId string The note to modify.
$desc string The first line of the note.
$body string The whole note body.
$tags string The tags of the note.
$passphrase string The passphrase to encrypt the note with.

move() public method

Moves a note to a new notepad.
public move ( string $noteId, string $newNotepad )
$noteId string The note to move.
$newNotepad string The new notepad.

retrieve() abstract public method

Retrieves all of the notes of the current notepad from the backend.
abstract public retrieve ( )

synchronize() public method

Perform any synchronization with backend data handlers that may be necessary for the driver.
public synchronize ( mixed $token = false )
$token mixed A value indicating the last synchronization point, if available.

toASNote() public method

Create an AS memo from this task
public toASNote ( array $memo, array $options = [] ) : Horde_ActiveSync_Message_Note
$memo array A memo array.
$options array
return Horde_ActiveSync_Message_Note

toiCalendar() public method

Export this memo in iCalendar format.
public toiCalendar ( $memo, $calendar ) : Horde_Icalendar_Vnote
return Horde_Icalendar_Vnote object for this event.

Property Details

$_memos protected_oe property

Array holding the current memo list. Each array entry is a hash describing a memo. The array is indexed numerically by memo ID.
protected array $_memos
return array

$_notepad protected_oe property

String containing the current notepad name.
protected string $_notepad
return string

$_pgp protected_oe property

Crypting processor.
protected Horde_Crypt_pgp $_pgp
return Horde_Crypt_pgp