File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -50,10 +50,12 @@ abstract class Record extends DataObject
50
50
/**
51
51
* Construct a CRUD object
52
52
*
53
+ * Reads from the database based on the parameters passed to the constructor. No parameters creates an empty object.
54
+ *
53
55
* ##### Possible $parameter types and values
54
56
* - **int** primary key value, will load object values if the primary key value exists
55
57
* - **string** primary key value, will load object values if the primary key value exists
56
- * - **array** object will be initialized to these values, but not read from the database
58
+ * - **array** record is attempted to be read from database using the values of the fields provided.
57
59
* - **null** (default) constructs an empty object
58
60
*/
59
61
public function __construct (int |array |null |string $ parameter = null )
@@ -437,6 +439,14 @@ public function insertOrUpdate() : int | bool
437
439
return $ this ->privateInsert (true );
438
440
}
439
441
442
+ /**
443
+ * Save the record, will either update if it exists or insert if not
444
+ */
445
+ public function save () : int | bool
446
+ {
447
+ return $ this ->privateInsert (true );
448
+ }
449
+
440
450
/**
441
451
* @return bool true if loaded from the disk
442
452
*/
You can’t perform that action at this time.
0 commit comments