Skip to content

Commit

Permalink
Fixed improperly named property name, fixed documentation conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Smef committed Oct 13, 2024
1 parent fce99ed commit 3cca36f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,14 +279,12 @@ $person->withModId()->save();
The modId is automatically set on the model object when you retrieve a record from FileMaker, so you don't need to set it manually.
If you always want the ModId to be included when saving a record, you can set the `$withModId` property to true on your model class.
```php
protected $useModId = true;
protected $withModId = true;
```
If you wish to always include a ModId on a model, you can set `protected $withModId = true;` on your model class.
## Example FMModel Class
```php
Expand Down
10 changes: 7 additions & 3 deletions src/Database/Eloquent/FMModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ abstract class FMModel extends Model
*/
protected $modId;

protected $useModId = false;
/**
* A flag to determine if the last retrieved ModId for the record should be sent when editing a record. The Data
* API will return an error if the record has been modified and current ModId does not match the one being sent.
*/
protected $withModId = false;

/**
* The "type" of the primary key ID. FileMaker uses UUID strings by default.
Expand Down Expand Up @@ -227,14 +231,14 @@ public function setModId($modId): void
public function withModId($include = true): static
{
// remove any set ModId if the user wishes to remove it
$this->useModId = $include;
$this->withModId = $include;

return $this;
}

public function usingModId(): bool
{
return $this->useModId;
return $this->withModId;
}

public function getReadOnlyFields()
Expand Down

0 comments on commit 3cca36f

Please sign in to comment.