We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 15c2b5a commit 88b9756Copy full SHA for 88b9756
user_guide_src/source/models/model/065.php
@@ -5,3 +5,15 @@
5
['email' => 'john@example.com'],
6
['name' => 'John Doe', 'country' => 'US'],
7
);
8
+
9
+// The above will trigger:
10
+//
11
+// 1) First it tries to find the record:
12
+// SELECT * FROM `users` WHERE `email` = 'john@example.com' LIMIT 1;
13
14
+// 2) If no result is found, it inserts a new record:
15
+// INSERT INTO `users` (`email`, `name`, `country`)
16
+// VALUES ('john@example.com', 'John Doe', 'US');
17
18
+// 3) Then it returns the found or newly created entity/row,
19
+// or false if something went wrong
0 commit comments