Documentation

FileMakerRelation implements Iterator

Class FileMakerRelation is the record set of queried data. This class implements Iterator interface.

The object of this class is going to be generated by the FileMakerLayout class, and you shouldn't call the constructor of this class.

Tags
link

GitHub Repository

@property

string $<<field_name>> The field value named as the property name.

@property

FileMakerRelation $<<portal_name>> FileMakerRelation object associated with the property name. The table occurrence name of the portal can be the 'portal_name,' and also the object name of the portal. Ver * @version 31

author

Masayuki Nii nii@msyk.net

copyright

2017-2023 Masayuki Nii (Claris FileMaker is registered trademarks of Claris International Inc. in the U.S. and other countries.)

Table of Contents

Interfaces

Iterator

Methods

count()  : int
Count the number of records.
current()  : FileMakerRelation|null
Return the current element. This method is implemented for Iterator interface.
field()  : string|FileMakerRelation
The field value of the first parameter.
getContainerData()  : string|null
Return the base64 encoded data in container field with streaming interface. The access with streaming url depends on the setCertValidating(_) call, and it can work on self-signed certificate as a default.
getFieldNames()  : array<string|int, mixed>
Return the array of field names.
getFirstRecord()  : FileMakerRelation|null
Returns the first record of the query result.
getFoundCount()  : null|int
Get the founded record count of a query to get this relation.
getLastRecord()  : FileMakerRelation|null
Returns the last record of the query result.
getModId()  : int
Return the value of special field modId in the current pointing record.
getPortalNames()  : array<string|int, mixed>
Return the array of portal names.
getRecordId()  : int
Return the value of special field recordId in the current pointing record.
getRecords()  : array<string|int, mixed>
Returns the array of the query result. Usually iterating by using foreach is a better way.
getReturnedCount()  : null|int
Get the returned record count of a query to get this relation.
getTargetTable()  : null|string
Get the table occurrence name of a query to get this relation.
getTotalCount()  : null|int
Get the total record count of a query to get this relation.
key()  : int
Return the key of the current element. This method is implemented for Iterator interface.
last()  : void
The record pointer goes to the first record.
moveTo()  : void
The record pointer goes to the specified record.
next()  : void
The record pointer goes forward to the previous record. This does not care the range of pointer value.
previous()  : void
The record pointer goes back to the previous record. This does not care the range of pointer value.
rewind()  : void
Rewind the Iterator to the first element. This method is implemented for Iterator interface.
setPortalName()  : void
If the portal name is different with the name used as the portal referencing name, this method can set it.
toArray()  : array<string|int, mixed>
Export to array
valid()  : bool
Checks if current position is valid. This method is implemented for Iterator interface.

Methods

count()

Count the number of records.

public count() : int

This method is defined in the Iterator interface.

Return values
int

The number of records.

field()

The field value of the first parameter.

public field(string $name[, string|null $toName = null ]) : string|FileMakerRelation

Or the FileMakerRelation object associated with the first parameter.

Parameters
$name : string

The field or portal name. The table occurrence name of the portal can be the portal name, and also the object name of the portal.

$toName : string|null = null

The table occurrence name of the portal as the prefix of the field name.

Tags
throws
Exception

The field specified in parameters doesn't exist.

see
FMDataAPI::setFieldHTMLEncoding()

Compatible mode for FileMaker API for PHP.

Return values
string|FileMakerRelation

The field value as string, or the FileMakerRelation object of the portal.

getContainerData()

Return the base64 encoded data in container field with streaming interface. The access with streaming url depends on the setCertValidating(_) call, and it can work on self-signed certificate as a default.

public getContainerData(string $name[, string|null $toName = null ]) : string|null

Thanks to 'base64bits' as https://github.com/msyk/FMDataAPI/issues/18.

Parameters
$name : string

The container field name. The table occurrence name of the portal can be the portal name, and also the object name of the portal.

$toName : string|null = null

The table occurrence name of the portal as the prefix of the field name.

Tags
throws
Exception
Return values
string|null

The base64 encoded data in container field.

getFieldNames()

Return the array of field names.

public getFieldNames() : array<string|int, mixed>
Return values
array<string|int, mixed>

List of field names

getFoundCount()

Get the founded record count of a query to get this relation.

public getFoundCount() : null|int

If the relation comes from getRecord() method, this method returns 1.

Return values
null|int

The founded record count.

getModId()

Return the value of special field modId in the current pointing record.

public getModId() : int
Return values
int

The value of special field modId.

getPortalNames()

Return the array of portal names.

public getPortalNames() : array<string|int, mixed>
Return values
array<string|int, mixed>

List of portal names

getRecordId()

Return the value of special field recordId in the current pointing record.

public getRecordId() : int
Return values
int

The value of special field recordId.

getRecords()

Returns the array of the query result. Usually iterating by using foreach is a better way.

public getRecords() : array<string|int, mixed>
Return values
array<string|int, mixed>

The FileMakerRelation objects of the records.

getReturnedCount()

Get the returned record count of a query to get this relation.

public getReturnedCount() : null|int

If the relation comes from getRecord() method, this method returns 1.

Return values
null|int

The returned record count.

getTargetTable()

Get the table occurrence name of a query to get this relation.

public getTargetTable() : null|string
Return values
null|string

The table occurrence name.

getTotalCount()

Get the total record count of a query to get this relation.

public getTotalCount() : null|int

Portal relation doesn't have this information and returns NULL.

Return values
null|int

The total record count.

key()

Return the key of the current element. This method is implemented for Iterator interface.

public key() : int
Return values
int

The current number as the record pointer.

moveTo()

The record pointer goes to the specified record.

public moveTo(int $position) : void
Parameters
$position : int

The position of the record. The first record is 0.

next()

The record pointer goes forward to the previous record. This does not care the range of pointer value.

public next() : void

previous()

The record pointer goes back to the previous record. This does not care the range of pointer value.

public previous() : void

rewind()

Rewind the Iterator to the first element. This method is implemented for Iterator interface.

public rewind() : void

setPortalName()

If the portal name is different with the name used as the portal referencing name, this method can set it.

public setPortalName(string $name) : void
Parameters
$name : string

The portal name.

toArray()

Export to array

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

valid()

Checks if current position is valid. This method is implemented for Iterator interface.

public valid() : bool
Return values
bool

Returns true on existing the record or false on not existing.


        
On this page

Search results