PHP Класс 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.
Наследование: extends Horde_Registry_Api
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$_links array Links.

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
_modified ( array $memo ) : integer Returns the last modification timestamp of a note.

Описание методов

_modified() защищенный Метод

Returns the last modification timestamp of a note.
protected _modified ( array $memo ) : integer
$memo array The note to look in.
Результат integer The timestamp for the last modification.

addNotepad() публичный Метод

Create a new notepad.
С версии: 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
Результат string The new notepad's id.

browse() публичный Метод

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'.
Результат array The contents of $path

delete() публичный Метод

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

deleteNotepad() публичный Метод

Delete notepad.
С версии: 4.2.0
public deleteNotepad ( string $id )
$id string The notepad id.

export() публичный Метод

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.
Результат mixed The requested data

getActionTimestamp() публичный Метод

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
Результат integer The timestamp or modseq for this action.

getChanges() публичный Метод

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
Результат array An hash with 'add', 'modify' and 'delete' arrays.

getChangesByModSeq() публичный Метод

Return all changes occuring between the specified modification sequences.
С версии: 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
Результат array The changes @see getChanges()

getDefaultShare() публичный Метод

Retrieve the UID for the current user's default notepad.
С версии: 4.2.0
public getDefaultShare ( ) : string
Результат string UID.

getHighestModSeq() публичный Метод

Return the largest modification sequence from the history backend.
С версии: 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
Результат integer The modseq.

import() публичный Метод

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.
Результат string The new UID, or false on failure.

listBy() публичный Метод

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
Результат array An array of UIDs matching the action and time criteria.

listNotepads() публичный Метод

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.
Результат array The notepads.

listTagInfo() публичный Метод

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.
Результат array An array containing tag_name, and total

listUids() публичный Метод

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.
Результат array An array of UIDs for all notes the user can access.

path_delete() публичный Метод

Deletes a file from the Mnemo tree.
public path_delete ( string $path ) : string
$path string The path to the file.
Результат string The note's UID

put() публичный Метод

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.
Результат array The note UIDs

removeUserData() публичный Метод

Removes user data.
Устаревший: Use Horde's removeUserData API call instead.
public removeUserData ( string $user )
$user string Name of user to remove data for.

replace() публичный Метод

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() публичный Метод

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?
Результат 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() публичный Метод

Returns a list of available sources.
С версии: 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.
Результат array An array of the available sources. Keys are source IDs, values are source titles.

updateNotepad() публичный Метод

Update a notepad's title and/or description.
С версии: 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.

Описание свойств