FileMakerRelation
in package
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
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. Or the FileMakerRelation object associated with the the first paramenter.
- getContainerData() : string
- 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 fiest record of the query result.
- getFoundCount() : int
- Get the founded record count of query to get this relation. If the relation comes from getRecord() method, this method returns 1.
- 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>|null
- Returns the array of the query result. Usually iterating by using foreach is a better way.
- getReturnedCount() : int
- Get the returned record count of query to get this relation. If the relation comes from getRecord() method, this method returns 1.
- getTargetTable() : string
- Get the table occurrence name of query to get this relation.
- getTotalCount() : int
- Get the total record count of query to get this relation. Portal relation doesn't have this information and returns NULL.
- key() : int
- Return the key of the current element. This method is implemented for Iterator interface.
- last() : void
- The record pointer goes to first record.
- moveTo() : void
- The record pointer goes to the specified record.
- next() : void
- The record pointer goes forward to previous record. This does not care the range of pointer value.
- previous() : void
- The record pointer goes back to 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() : void
- Export to array
- valid() : bool
- Checks if current position is valid. This method is implemented for Iterator interface.
- getNumberedRecord() : mixed
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.
current()
Return the current element. This method is implemented for Iterator interface.
public
current() : FileMakerRelation|null
Return values
FileMakerRelation|null —The record set of the current pointing record.
field()
The field value of the first parameter. Or the FileMakerRelation object associated with the the first paramenter.
public
field(string $name[, string $toName = null ]) : string|FileMakerRelation
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
-
The table occurrence name of the portal as the prefix of the field name.
Tags
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 $toName = null ]) : string
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
-
The table occurrence name of the portal as the prefix of the field name.
Return values
string —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
getFirstRecord()
Returns the fiest record of the query result.
public
getFirstRecord() : FileMakerRelation|null
Return values
FileMakerRelation|null —The record set of the record.
getFoundCount()
Get the founded record count of query to get this relation. If the relation comes from getRecord() method, this method returns 1.
public
getFoundCount() : int
Return values
int —The founded record count.
getLastRecord()
Returns the last record of the query result.
public
getLastRecord() : FileMakerRelation|null
Return values
FileMakerRelation|null —The record set of the record.
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>|null
Return values
array<string|int, mixed>|null —The FileMakerRelation objects of the records.
getReturnedCount()
Get the returned record count of query to get this relation. If the relation comes from getRecord() method, this method returns 1.
public
getReturnedCount() : int
Return values
int —The rreturned record count.
getTargetTable()
Get the table occurrence name of query to get this relation.
public
getTargetTable() : string
Return values
string —The table occurrence name.
getTotalCount()
Get the total record count of query to get this relation. Portal relation doesn't have this information and returns NULL.
public
getTotalCount() : int
Return values
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.
last()
The record pointer goes to first record.
public
last() : void
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 previous record. This does not care the range of pointer value.
public
next() : void
previous()
The record pointer goes back to 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() : void
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.
getNumberedRecord()
private
getNumberedRecord(mixed $num) : mixed
Parameters
- $num : mixed