Class FileMaker_Record

Description

This is the default Record class for representing each member of a

result set. Records can have references to their parent or child records, can be edited or deleted, etc. You can also specify a different class to use for Records; that class should be a subclass of this base class, or encapsulate its functionality. In PHP5 this class would implement an interface that alternate classes would be required to implement as well.

Located in /FileMaker/Record.php (line 32)


	
			
Method Summary
boolean commit ()
FileMaker_Response delete ()
string getField (string $field, integer $repetition)
integer getFieldAsTimestamp (mixed $field, mixed $repetition)
array getFields ()
integer getModificationId ()
integer getRecordId ()
array &getRelatedSet (string $relatedSet)
FileMaker_Record &newRelatedRecord (string $relatedSet)
void setField (string $field, string $value, integer $repetition)
void setFieldFromTimestamp (string $field, string $timestamp, integer $repetition)
void validate ([mixed $fieldName = null])
Methods
Constructor FileMaker_Record (line 48)

Record constructor.

FileMaker_Record FileMaker_Record (FileMaker_Layout|FileMaker_RelatedSet &$layout)
commit (line 218)

Save any changes to this record back to the server.

  • return: True, or a FileMaker_Error on failure.
boolean commit ()
delete (line 228)

Delete this record from the server.

  • return: The response object.
FileMaker_Response delete ()
getField (line 86)

Get the value of $field.

  • return: The field value.
string getField (string $field, integer $repetition)
  • string $field: The field name to fetch.
  • integer $repetition: The repetition number to get, defaults to the first repetition.
getFieldAsTimestamp (line 103)

Return the value of the specified field (and repetition) as a

unix timestamp. If the field is a date field, the timestamp is for the field date at midnight. It the field is a time field, the timestamp is for that time on January 1, 1970. Timestamp (date & time) fields map directly to the unix timestamp. If the specified field is not a date or time field, or if the timestamp generated would be out of range, then we return a FileMaker_Error object instead.

  • return: The timestamp value.
integer getFieldAsTimestamp (mixed $field, mixed $repetition)
getFields (line 72)

Return a list of the names of all fields in the record. Just

the names are returned; if additional information is required then the Layout object provided by the parent FileMaker_Response object's getLayout() method must be consulted.

  • return: Field names
array getFields ()
getLayout (line 58)

Return the layout this record is part of.

  • return: This record's layout.
FileMaker_Layout &getLayout ()
getModificationId (line 155)

Get the modification id of this object.

  • return: The modification id.
integer getModificationId ()
getParent (line 189)

If this is a child record, return its parent.

  • return: The parent record.
FileMaker_Record &getParent ()
getRecordId (line 145)

Get the record id of this object.

  • return: The record id.
integer getRecordId ()
getRelatedSet (line 167)

Get any objects in the related set (portal) $relatedSet.

  • return: An array of FileMaker_Record objects from $relatedSet.
array &getRelatedSet (string $relatedSet)
  • string $relatedSet: The name of the related set (portal) to return records for.
newRelatedRecord (line 179)

Create a new record in the related set (portal) named by $relatedSet.

  • return: The blank record.
FileMaker_Record &newRelatedRecord (string $relatedSet)
  • string $relatedSet: The name of the portal to create a new record in.
setField (line 116)

Set the value of $field.

void setField (string $field, string $value, integer $repetition)
  • string $field: The field to change.
  • string $value: The new value.
  • integer $repetition: The repetition number to set, defaults to the first repetition.
setFieldFromTimestamp (line 135)

Set the new value for a date, time, or timestamp field from a unix timestamp value. If the field is not a date or time field, then an error is returned. Otherwise returns true.

If we haven't already loaded layout data for the target of this command, calling this method will cause it to be loaded so that the type of the field can be checked.

void setFieldFromTimestamp (string $field, string $timestamp, integer $repetition)
  • string $field: The field to set.
  • string $timestamp: The timestamp value.
  • integer $repetition: The repetition number to set, defaults to the first repetition.
validate (line 208)

Validates either a single field or the whole record against the

validation rules that are enforceable on the PHP side - type rules, ranges, four-digit dates, etc. Rules such as unique or existing, or validation by calculation field, cannot be pre-validated.

If the optional $fieldName argument is passed, only that field will be validated. Otherwise the record will be validated just as if commit() were called with prevalidation turned on in the API properties. validate() returns TRUE if validation passes, or a FileMaker_Error_Validation object containing details about what failed to validate.

void validate ([mixed $fieldName = null])

Documentation generated on Thu, 06 Jul 2006 15:52:33 -0700 by phpDocumentor 1.2.3