Skip to content

Commit 6ef81c0

Browse files
committed
fixed issue with setGlobalFields and added example
1 parent 5c3627a commit 6ef81c0

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ Here are a list of methods which will allow you to set the parameters for the D
241241
FM::table()
242242
FM::connection()
243243
FM::layout() // alias for table()
244+
FM::setGlobalFields() // not chainable
244245
```
245246

246247
#### Chainable
@@ -320,6 +321,16 @@ Create a record with an array of field data and then perform a script after reco
320321
FM::layout('MyLayoutName')->script('ScriptName')->fieldData($data)->createRecord();
321322
```
322323

324+
Set a global field. The full `table_name::field_name` syntax is required for global fields.
325+
```php
326+
$globalFields = [
327+
'GLOB::my_global_field' => 'New global value',
328+
'GLOB::other_global_field' => 'New global value',
329+
330+
];
331+
FM::setGlobalFields($globalFields);
332+
```
333+
323334
## Logging out, disconnecting, and ending your Data API session
324335

325336
Eloquent-FileMaker attempts to automatically re-use session tokens by caching the session token between requests. This means that you will see the session remain open in your FileMaker Server admin console. It will be automatically disconnected by your server based on your server or database's disconnection settings.

src/Database/Query/FMBaseBuilder.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ class FMBaseBuilder extends Builder
133133
*/
134134
public function where($column, $operator = null, $value = null, $boolean = 'and'): FMBaseBuilder
135135
{
136-
137136
// This is an "orWhere" type query, so add a find request and then work from there
138137
if ($boolean === 'or') {
139138
$this->addFindRequest();
@@ -858,7 +857,7 @@ public function setGlobalFields(array $globals)
858857
{
859858
$this->globalFields = $globals;
860859

861-
return $this->connection->setGlobalFields($this);
860+
return $this->connection->setGlobalFields($globals);
862861
}
863862

864863
/**

0 commit comments

Comments
 (0)