Skip to content

Commit f7a761e

Browse files
committed
Ready for Ver.29, also close #64
1 parent eed61d5 commit f7a761e

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

samples/FMDataAPI_Sample.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
// Instantiate the class FMDataAPI with database name, user name, password and host.
2020
// Although the port number and protocol can be set in parameters of constructor,
2121
// these parameters can be omitted with default values.
22-
$fmdb = new FMDataAPI("TestDB", "web", "password", "192.168.17.130" /*"localhost"*/);
22+
$fmdb = new FMDataAPI("TestDB", "web", "password", "localhost");
2323

2424
//==============================
2525
//$fmdb = new FMDataAPI("TestDB", "web", "password", "localserver");
@@ -59,7 +59,6 @@
5959
$pInfo = var_export($result, true);
6060
echo htmlspecialchars("Layout Metadata (Old): {$pInfo}", ENT_QUOTES, "UTF-8") . "<hr>";
6161

62-
exit;
6362
// The FMDataAPI has the property as the same name of layout. This sample database has the 'person_layout' layout,
6463
// so '$fmdb->person_layout' refers FMLayout object fo the proxy of the layout. FMLayout class has the 'query' method
6564
// and returns FileMakerRelation class's object. The condition spefied in parameter is same as FileMaker's Find Record API.
@@ -271,12 +270,14 @@
271270
}
272271
}
273272

274-
//
273+
// The getFirstRecord method returns FileMakerRelation class object.
275274
$result = $fmdb->person_layout->query();
276275
$first = $result->getFirstRecord();
277-
echo "id field of the first record: {$first->field('id')}";
276+
echo "id field of the first record: {$first->field('id')}<br>";
277+
$portals = $first->getPortalNames();
278+
echo "getPortalNames of the first record: " . var_export($portals, true) . "<br>";
278279
$contacts = $first->Contact;
279-
echo "[PORTAL(contact_to)] id: {$contacts->field("id", "contact_to")}";
280+
echo "[PORTAL(contact_to)] id: {$contacts->field("id", "contact_to")}<br>";
280281

281282
} catch (Exception $e) {
282283
echo '<div><h3>例外発生</h3>', htmlspecialchars($e->getMessage(), ENT_QUOTES, "UTF-8"), "<div>";

src/FMDataAPI.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class FMDataAPI
5252
* @param array $fmDataSource Authentication information for external data sources.
5353
* Ex. [{"database"=>"<databaseName>", "username"=>"<username>", "password"=>"<password>"].
5454
* If you use OAuth, "oAuthRequestId" and "oAuthIdentifier" keys have to be spedified.
55-
* @param boolean $isUnitTest It it's set to true, the communication provider just works locally.
55+
* @param boolean $isUnitTest If it's set to true, the communication provider just works locally.
5656
*/
5757
public function __construct(
5858
$solution, $user, $password, $host = null, $port = null, $protocol = null, $fmDataSource = null, $isUnitTest = false)

0 commit comments

Comments
 (0)