File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -167,6 +167,11 @@ public function editRecord()
167167 }
168168 }
169169
170+ // set the ModID if that option is set on the model
171+ if ($ model ->usingModId ()) {
172+ $ this ->query ->modId ($ model ->getModId ());
173+ }
174+
170175 if ($ fieldsToWrite ->count () > 0 || count ($ modifiedPortals ) > 0 ) {
171176 // we have some regular text fields to update
172177 // 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
6565 */
6666 protected $ modId ;
6767
68+ protected $ useModId = false ;
69+
6870 /**
6971 * The "type" of the primary key ID. FileMaker uses UUID strings by default.
7072 *
@@ -219,6 +221,22 @@ public function setModId($modId): void
219221 $ this ->modId = $ modId ;
220222 }
221223
224+ /**
225+ * Include the modification Id when editing a record
226+ */
227+ public function withModId ($ include = true ): static
228+ {
229+ // remove any set ModId if the user wishes to remove it
230+ $ this ->useModId = $ include ;
231+
232+ return $ this ;
233+ }
234+
235+ public function usingModId (): bool
236+ {
237+ return $ this ->useModId ;
238+ }
239+
222240 public function getReadOnlyFields ()
223241 {
224242 return $ this ->readOnlyFields ;
You can’t perform that action at this time.
0 commit comments