Xataface 2.0
Xataface Application Framework
Public Member Functions | Static Public Member Functions | Data Fields
Dataface_Clipboard Class Reference

Public Member Functions

 Dataface_Clipboard ($id)
 isInstalled ()
 install ()
 clean ()
 shotgunClean ()
 empty ()
 copy ($recordids)
 cut ($recordids)
 paste ($destid, $relationship=null)
 logError ($error)
 logWarning ($warning)
 logMessage ($message)
 clearLogs ()

Static Public Member Functions

static & getInstance ()

Data Fields

 $id
 $errors
 $warnings
 $messages

Detailed Description

A clipboard class to enable users to cut and paste records between relationships and tables.

Definition at line 13 of file Clipboard.php.


Member Function Documentation

clean ( )

Cleans out old entries from the clipboard. static

Definition at line 66 of file Clipboard.php.

clearLogs ( )

Definition at line 278 of file Clipboard.php.

copy ( recordids)

Copies the given record onto the clipboard.

This takes multilingual issues into account so that transation records in translation tables will also be copied.

Parameters:
array$recordidsArray of record ids of the records to copy. Record ids follow the pattern: table/relationship?key1=val1&key2=val2&relationship::key1=val1&relationship::key2=val2
Returns:
boolen True if the copy is successful.

Definition at line 141 of file Clipboard.php.

cut ( recordids)

Cuts a record and stores it on the clipboard. This won't erase the record until it is pasted.

Parameters:
array$recordids
Returns:
boolean True if the cut is successful.

Definition at line 167 of file Clipboard.php.

Dataface_Clipboard ( id)

Definition at line 20 of file Clipboard.php.

empty ( )

Indicates whether the clipboard is empty.

Returns:
boolean True if the clipboard is empty for the current user.

Definition at line 125 of file Clipboard.php.

static& getInstance ( ) [static]

Obtains a reference to the clipboard instance.

Returns:
Dataface_Clipboard If the user is logged in or sessions are enabled. Otherwise will return a PEAR_Error object. static

Definition at line 94 of file Clipboard.php.

install ( )

Installs the clipboard by creating a table named '_df_clipboard' in the database to store the clipped items. static

Definition at line 43 of file Clipboard.php.

isInstalled ( )

Checks whether the clipboard is currently installed. staticlutie

Definition at line 28 of file Clipboard.php.

logError ( error)

Definition at line 266 of file Clipboard.php.

logMessage ( message)

Definition at line 274 of file Clipboard.php.

logWarning ( warning)

Definition at line 270 of file Clipboard.php.

paste ( destid,
relationship = null 
)

Pastes a record from the clipboard into a new location. The new location may be a table or in a relationship with another record.

Parameters:
string$destidThe id of the destination record.
string$relationshipThe name of the relationship into which the clipboard contents should be pasted. If none is provided the contents will be pasted into the relationship designated as the chldren relationship.
Returns:
mixed True if the paste is sucessful. If it fails, it will return a PEAR_Error object with the reason for failure.

Definition at line 196 of file Clipboard.php.

shotgunClean ( )

Cleans the old entries from the clipboard using a shotgun approach. This generates a random number betweenm 0 and 100 and cleans the clipboard only if the number is above the threshold defined in the Dataface_Clipboard_threshold constant. static

Definition at line 80 of file Clipboard.php.


Field Documentation

$errors

Definition at line 16 of file Clipboard.php.

$id

Definition at line 15 of file Clipboard.php.

$messages

Definition at line 18 of file Clipboard.php.

$warnings

Definition at line 17 of file Clipboard.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations