IMuModule

require_once IMu::$lib . '/Module.php';

Since: 1.0

Description

Provides access to an EMu module.

Constructors

Constructor

Details

__construct($table, $session)

__construct(string $table [, IMuSession $session = null])

Creates an object which can be used to access an EMu module.

If the $session parameter is null a new session is created automatically using the IMuSession class's defaultHost and defaultPort values.

Parameters:

$table (string)

Name of the EMu module to be accessed.

$session (IMuSession)

A Session object to be used to communicate with the IMu server.

Defaults to null if not supplied.

Properties

Property

Details

table

The name of the table associated with the IMuModule object.

Type:

string

Getter:

string getTable()

 

Methods

Method

Details

addFetchSet($name, $columns)

int addFetchSet(string $name, mixed $columns)

Associates a set of columns with a logical name on the server.

The name can be used instead of a column list when retrieving data using fetch( ).

addFetchSets($sets)

int addFetchSets(array $sets)

Associates several sets of columns with logical names on the server.

This is the equivalent of calling addFetchSet( ) for each entry in the map but is more efficient.

addSearchAlias($name, $columns)

int addSearchAlias(string $name, mixed $columns)

Associates a set of columns with a logical name on the server.

The name can be used when specifying search terms to be passed to findTerms( ). The search becomes the equivalent of an OR search involving the columns.

addSearchAliases($aliases)

int addSearchAliases(array $aliases)

Associates several sets of columns with logical names on the server.

This is the equivalent of calling addSearchAlias( ) for each entry in the map but is more efficient.

addSortSet($name, $keys)

int addSortSet(string $name, mixed $keys)

Associates several sets of columns with logical names on the server.

The name can be used instead of a sort key list when sorting the current result set using sort( ).

addSortSets($sets)

int addSortSets(array $sets)

Associates several sets of sort keys with logical names on the server.

This is the equivalent of calling addSortSet( ) for each entry in the list but is more efficient.

fetch($flag, $offset, $count, $columns)

IMuModuleFetchResult fetch(string $flag, int $offset, int $count [, mixed $columns = null])

Fetches count records from the position described by a combination of flag and offset.

fetchHierarchy($key, $parent)

fetchHierarchy(int $key, string $parent)

Fetches a hierarchy of records around the record with the key value of $key.

findKey($key)

int findKey(int $key)

Searches for a record with the key value $key.

findKeys($keys)

int findKeys(array $keys)

Searches for records with key values in the array $keys.

findTerms($terms)

int findTerms(mixed $terms)

Searches for records which match the search terms specified in $terms.

findWhere($where)

int findWhere(string $where)

Searches for records which match the TexQL WHERE clause.

restoreFromFile($file)

int restoreFromFile(string $file)

Restores a set of records from a file on the server machine which contains a list of keys, one per line.

restoreFromTemp($file)

int restoreFromTemp(string $file)

Restores a set of records from a temporary file on the server machine which contains a list of keys, one per line.

Operates the same way as restoreFromFile( ) except that the file parameter is relative to the server's temporary directory.

sort($keys, $flags)

ModuleSortResult sort(mixed $keys [, mixed $flags = null])

Sorts the current result set by the sort keys in $keys. Each sort key is a column name optionally preceded by a + (for an ascending sort) or a - (for descending sort).