Skip to content

Commit 3d6a8de

Browse files
committed
Checking some methods (as like getFirstRecord) to work for all methods.
1 parent 4b031e6 commit 3d6a8de

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

src/Supporting/FileMakerRelation.php

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -335,15 +335,24 @@ public function getPortalNames()
335335
{
336336
$list = [];
337337
if (isset($this->data)) {
338-
foreach ($this->data as $key) {
339-
if (property_exists($key, 'portalData')) {
340-
foreach ($key->portalData as $name => $val) {
341-
array_push($list, $name);
338+
switch ($this->result) {
339+
case 'OK':
340+
foreach ($this->data as $key) {
341+
if (property_exists($key, 'portalData')) {
342+
foreach ($key->portalData as $name => $val) {
343+
array_push($list, $name);
344+
}
345+
}
346+
}
347+
break;
348+
case 'RECORD':
349+
if (property_exists($this->data, 'portalData')) {
350+
foreach ($this->data->portalData as $name => $val) {
351+
array_push($list, $name);
352+
}
342353
}
343-
}
344354
}
345355
}
346-
347356
return $list;
348357
}
349358

0 commit comments

Comments
 (0)