# Docs For Class FileMaker_Command

## Class FileMaker_Command

Description

Base Command class. Represents commands that add records, delete records, duplicate records, edit records, perform find requests, and perform ScriptMaker scripts.

Located in /FileMaker/Command.php (line 29)

Direct descendents

Class | Description
--- | ---
FileMaker_Command_Add | Command class that adds a new record.
FileMaker_Command_CompoundFind | Command class that performs multiple find requests, also known as a compound find set.
FileMaker_Command_Delete | Command class that deletes a single record.
FileMaker_Command_Duplicate | Command class that duplicates a single record.
FileMaker_Command_Edit | Command class that edits a single record.
FileMaker_Command_Find | Command class that finds records using the specified criteria.
FileMaker_Command_PerformScript | Command class that performs a ScriptMaker script.

Method Summary
FileMaker_Result &execute ()
void setPreCommandScript (string $scriptName, [string $scriptParameters = null])
void setPreSortScript (string $scriptName, [string $scriptParameters = null])
void setRecordClass (string $className)
void setRecordId (string $recordId)
void setResultLayout (string $layout)
void setScript (string $scriptName, [string $scriptParameters = null])
boolean|FileMaker_Error_Validation validate ([string $fieldName = null])
Methods
execute (line 135)

Executes the command.

- return: Result object.

FileMaker_Result &execute ()
setPreCommandScript (line 69)

Sets a ScriptMaker script to be run before performing a command.

void setPreCommandScript (string $scriptName, [string $scriptParameters = null])

- string $scriptName: Name of the ScriptMaker script to run.
- string $scriptParameters: Any parameters to pass to the script.

setPreSortScript (line 81)

Sets a ScriptMaker script to be run after performing a Find command, but before sorting the result set.

void setPreSortScript (string $scriptName, [string $scriptParameters = null])

- string $scriptName: Name of the ScriptMaker script to run.
- string $scriptParameters: Any parameters to pass to the script.

setRecordClass (line 98)

Sets the PHP class that the API instantiates to represent records returned in any result set.

The default is to use the provided FileMaker_Record class. Any substitute classes must provide the same API that FileMaker_Record does, either by extending it or re-implementing the necessary methods. The user is responsible for defining any custom class before the API needs to instantiate it.

void setRecordClass (string $className)

- string $className: Name of the class to represent records.

setRecordId (line 149)

Sets the record ID for this command.

For Edit, Delete, and Duplicate commands, a record ID must be specified. It is also possible to find a single record by specifying its record ID. This method is ignored by Add and FindAny commands.

void setRecordId (string $recordId)

- string $recordId: ID of record this command acts upon.

setResultLayout (line 46)

Requests that the command's result be returned in a layout different from the current layout.

void setResultLayout (string $layout)

- string $layout: Layout to return results in.

setScript (line 58)

Sets a ScriptMaker script to be run after the Find result set is generated and sorted.

void setScript (string $scriptName, [string $scriptParameters = null])

- string $scriptName: Name of the ScriptMaker script to run.
- string $scriptParameters: Any parameters to pass to the script.

validate (line 125)

Pre-validates either a single field or the entire command.

This method uses the pre-validation rules that are enforceable by the PHP engine -- for example, type rules, ranges, and four-digit dates. Rules such as "unique" or "existing," or validation by calculation field, cannot be pre-validated.

If you pass the optional $fieldName argument, only that field is pre-validated. Otherwise, the command is pre-validated as if execute() were called with "Enable record data pre-validation" selected in FileMaker Server Admin Console. If pre-validation passes, validate() returns TRUE. If pre-validation fails, then validate() returns a FileMaker_Error_Validation object containing details about what failed to pre-validate.

- return: TRUE, if pre-validation passes. Otherwise, an Error Validation object.

boolean|FileMaker_Error_Validation validate ([string $fieldName = null])

- string $fieldName: Name of field to pre-validate. If empty, pre-validates the entire command.

Documentation generated on Mon, 28 Jul 2008 14:47:44 -0700 by phpDocumentor 1.4.0