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
파일 보기 프로젝트 열기: horde/horde

보호된 프로퍼티들

프로퍼티 타입 설명
$_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.

프로퍼티 상세