PHP Class Mnemo_Api, horde

This file defines Mnemo's external API interface. Other applications can interact with Mnemo through this API. Copyright 2001-2014 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.
Inheritance: extends Horde_Registry_Api
Afficher le fichier Open project: horde/horde

Protected Properties

Свойство Type Description
$_links array Links.

Méthodes publiques

Méthode Description
addNotepad ( string $name, array $params = [] ) : string Create a new notepad.
browse ( string $path = '', array $properties = [] ) : array Browse through Mnemo's object tree.
delete ( string | array $uid ) Delete a memo identified by UID.
deleteNotepad ( string $id ) Delete notepad.
export ( string $uid, string $contentType, array $options = [] ) : mixed Export a memo, identified by UID, in the requested contentType.
getActionTimestamp ( string $uid, string $action, string $notepad = null, boolean $modSeq = false ) : integer Returns the timestamp of an operation for a given uid an action.
getChanges ( integer $start, integer $end, boolean $isModSeq = false, string $notepad = null ) : array Method for obtaining all server changes between two timestamps. Basically a wrapper around listBy(), but returns an array containing all adds, edits and deletions.
getChangesByModSeq ( integer $start, integer $end, string $notepad = null ) : array Return all changes occuring between the specified modification sequences.
getDefaultShare ( ) : string Retrieve the UID for the current user's default notepad.
getHighestModSeq ( string $id = null ) : integer Return the largest modification sequence from the history backend.
import ( string $content, string $contentType, string $notepad = null ) : string Import a memo represented in the specified contentType.
listBy ( string $action, integer $timestamp, string $notepad = null, integer $end = null, boolean $isModSeq = false ) : array Returns an array of UIDs for notes that have had $action happen since $timestamp.
listNotepads ( boolean $owneronly, integer $permission ) : array
listTagInfo ( array $tags = null, $user = null ) : array Retrieve the list of used tag_names, tag_ids and the total number of resources that are linked to that tag.
listUids ( array | string $notepads = null ) : array Returns an array of UIDs for all notes that the current user is authorized to see.
path_delete ( string $path ) : string Deletes a file from the Mnemo tree.
put ( string $path, string $content, string $content_type ) : array Saves a file into the Mnemo tree.
removeUserData ( string $user ) Removes user data.
replace ( string $uid, string $content, string $contentType ) Replace the memo identified by UID with the content represented in the specified contentType.
searchTags ( array $names, integer $max = 10, integer $from, string $resource_type = '', string $user = null, boolean $raw = false ) : array SearchTags API: Returns an application-agnostic array (useful for when doing a tag search across multiple applications)
sources ( boolean $writeable = false, boolean $sync_only = false ) : array Returns a list of available sources.
updateNotepad ( string $id, array $info ) Update a notepad's title and/or description.

Méthodes protégées

Méthode Description
_modified ( array $memo ) : integer Returns the last modification timestamp of a note.

Method Details

_modified() protected méthode

Returns the last modification timestamp of a note.
protected _modified ( array $memo ) : integer
$memo array The note to look in.
Résultat integer The timestamp for the last modification.

addNotepad() public méthode

Create a new notepad.
Since: 4.2.0
public addNotepad ( string $name, array $params = [] ) : string
$name string The notepad display name.
$params array Any additional parameters needed. - synchronize: (boolean) If true, add notepad to the list of notepads to syncronize. DEFAULT: false (do not add to the list). @since 4.2.1
Résultat string The new notepad's id.

browse() public méthode

Browse through Mnemo's object tree.
public browse ( string $path = '', array $properties = [] ) : array
$path string The level of the tree to browse.
$properties array The item properties to return. Defaults to 'name', 'icon', and 'browseable'.
Résultat array The contents of $path

delete() public méthode

Delete a memo identified by UID.
public delete ( string | array $uid )
$uid string | array

deleteNotepad() public méthode

Delete notepad.
Since: 4.2.0
public deleteNotepad ( string $id )
$id string The notepad id.

export() public méthode

Export a memo, identified by UID, in the requested contentType.
public export ( string $uid, string $contentType, array $options = [] ) : mixed
$uid string Identify the memo to export.
$contentType string What format should the data be in? A string with one of:
  'text/plain'
  'text/x-vnote'
  'activesync'
$options array Any additional options to be passed to the exporter.
Résultat mixed The requested data

getActionTimestamp() public méthode

Returns the timestamp of an operation for a given uid an action.
public getActionTimestamp ( string $uid, string $action, string $notepad = null, boolean $modSeq = false ) : integer
$uid string The uid to look for.
$action string The action to check for - add, modify, or delete.
$notepad string The notepad to search in.
$modSeq boolean Request a modification sequence instead of a timestamp. @since 4.1.1
Résultat integer The timestamp or modseq for this action.

getChanges() public méthode

Method for obtaining all server changes between two timestamps. Basically a wrapper around listBy(), but returns an array containing all adds, edits and deletions.
public getChanges ( integer $start, integer $end, boolean $isModSeq = false, string $notepad = null ) : array
$start integer The starting timestamp
$end integer The ending timestamp.
$isModSeq boolean If true, $timestamp and $end are modification sequences and not timestamps. @since 4.1.1
$notepad string The source to check. @since 4.2.0
Résultat array An hash with 'add', 'modify' and 'delete' arrays.

getChangesByModSeq() public méthode

Return all changes occuring between the specified modification sequences.
Since: 4.1.1
public getChangesByModSeq ( integer $start, integer $end, string $notepad = null ) : array
$start integer The starting modseq.
$end integer The ending modseq.
$notepad string The source to check. @since 4.2.0
Résultat array The changes @see getChanges()

getDefaultShare() public méthode

Retrieve the UID for the current user's default notepad.
Since: 4.2.0
public getDefaultShare ( ) : string
Résultat string UID.

getHighestModSeq() public méthode

Return the largest modification sequence from the history backend.
Since: 4.1.1
public getHighestModSeq ( string $id = null ) : integer
$id string The notepad id to get the MODSEQ for. If null, the highest MODSEQ across all notepads is returned. @since 4.2.0
Résultat integer The modseq.

import() public méthode

Import a memo represented in the specified contentType.
public import ( string $content, string $contentType, string $notepad = null ) : string
$content string The content of the memo.
$contentType string What format is the data in? Currently supports: text/plain text/x-vnote activesync
$notepad string (optional) The notepad to save the memo on.
Résultat string The new UID, or false on failure.

listBy() public méthode

Returns an array of UIDs for notes that have had $action happen since $timestamp.
public listBy ( string $action, integer $timestamp, string $notepad = null, integer $end = null, boolean $isModSeq = false ) : array
$action string The action to check for - add, modify, or delete.
$timestamp integer The time to start the search.
$notepad string The notepad to search in.
$end integer The optional ending timestamp.
$isModSeq boolean If true, $timestamp and $end are modification sequences and not timestamps. @since 4.1.1
Résultat array An array of UIDs matching the action and time criteria.

listNotepads() public méthode

public listNotepads ( boolean $owneronly, integer $permission ) : array
$owneronly boolean Only return notepads that this user owns? Defaults to false.
$permission integer The permission to filter notepads by.
Résultat array The notepads.

listTagInfo() public méthode

Retrieve the list of used tag_names, tag_ids and the total number of resources that are linked to that tag.
public listTagInfo ( array $tags = null, $user = null ) : array
$tags array An optional array of tag_ids. If omitted, all tags will be included.
Résultat array An array containing tag_name, and total

listUids() public méthode

Returns an array of UIDs for all notes that the current user is authorized to see.
public listUids ( array | string $notepads = null ) : array
$notepads array | string The notepad(s) to list notes from.
Résultat array An array of UIDs for all notes the user can access.

path_delete() public méthode

Deletes a file from the Mnemo tree.
public path_delete ( string $path ) : string
$path string The path to the file.
Résultat string The note's UID

put() public méthode

Saves a file into the Mnemo tree.
public put ( string $path, string $content, string $content_type ) : array
$path string The path where to PUT the file.
$content string The file content.
$content_type string The file's content type.
Résultat array The note UIDs

removeUserData() public méthode

Removes user data.
Deprecation: Use Horde's removeUserData API call instead.
public removeUserData ( string $user )
$user string Name of user to remove data for.

replace() public méthode

Replace the memo identified by UID with the content represented in the specified contentType.
public replace ( string $uid, string $content, string $contentType )
$uid string Idenfity the memo to replace.
$content string The content of the memo.
$contentType string What format is the data in? Currently supports: text/plain text/x-vnote activesync

searchTags() public méthode

The 'raw' results array can be returned instead by setting $raw = true.
public searchTags ( array $names, integer $max = 10, integer $from, string $resource_type = '', string $user = null, boolean $raw = false ) : array
$names array An array of tag_names to search for.
$max integer The maximum number of resources to return.
$from integer The number of the resource to start with.
$resource_type string The resource type [bookmark, '']
$user string Restrict results to resources owned by $user.
$raw boolean Return the raw data?
Résultat array An array of results:
 'title'    - The title for this resource.
 'desc'     - A terse description of this resource.
 'view_url' - The URL to view this resource.
 'app'      - The Horde application this resource belongs to.
 'icon'     - URL to an image.

sources() public méthode

Returns a list of available sources.
Since: 4.2.0
public sources ( boolean $writeable = false, boolean $sync_only = false ) : array
$writeable boolean If true, limits to writeable sources.
$sync_only boolean Only include synchable notepads.
Résultat array An array of the available sources. Keys are source IDs, values are source titles.

updateNotepad() public méthode

Update a notepad's title and/or description.
Since: 4.2.0
public updateNotepad ( string $id, array $info )
$id string The notepad id
$info array The data to change: - name: The display name. - desc: The description.

Property Details