File tree 2 files changed +18
-0
lines changed
2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -167,6 +167,11 @@ public function editRecord()
167
167
}
168
168
}
169
169
170
+ // set the ModID if that option is set on the model
171
+ if ($ model ->withModId ()) {
172
+ $ this ->query ->modId ($ model ->getModId ());
173
+ }
174
+
170
175
if ($ fieldsToWrite ->count () > 0 || count ($ modifiedPortals ) > 0 ) {
171
176
// we have some regular text fields to update
172
177
// forward this request to a base query builder to execute the edit record request
Original file line number Diff line number Diff line change @@ -65,6 +65,8 @@ abstract class FMModel extends Model
65
65
*/
66
66
protected $ modId ;
67
67
68
+ protected $ useModId = false ;
69
+
68
70
/**
69
71
* The "type" of the primary key ID. FileMaker uses UUID strings by default.
70
72
*
@@ -219,6 +221,17 @@ public function setModId($modId): void
219
221
$ this ->modId = $ modId ;
220
222
}
221
223
224
+ /**
225
+ * Include the modification Id when editing a record
226
+ */
227
+ public function withModId ($ include = true ): self
228
+ {
229
+ // remove any set ModId if the user wishes to remove it
230
+ $ this ->useModId = $ include ;
231
+
232
+ return $ this ;
233
+ }
234
+
222
235
public function getReadOnlyFields ()
223
236
{
224
237
return $ this ->readOnlyFields ;
You can’t perform that action at this time.
0 commit comments