Skip to content

Commit 200b4ae

Browse files
committed
Simplify admonition
1 parent ac12229 commit 200b4ae

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

en/orm/saving-data.rst

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,13 +1182,14 @@ ideal in scenarios where you need to reduce the chance of duplicate records::
11821182
}
11831183
);
11841184

1185-
.. versionadded:: 5.2.0
1186-
Instead of a callback, the second argument can also be directly a data array::
1185+
As of 5.2.0, you can provide an array of data to set into the entity when it is
1186+
created::
11871187

1188-
$record = $table->findOrCreate(
1189-
['email' => 'bobbi@example.com'],
1190-
$otherData,
1191-
);
1188+
$otherData = ['name' => 'bobbi'];
1189+
$record = $table->findOrCreate(
1190+
['email' => 'bobbi@example.com'],
1191+
$otherData,
1192+
);
11921193

11931194
If your find conditions require custom order, associations or conditions, then
11941195
the ``$search`` parameter can be a callable or ``SelectQuery`` object. If you use
@@ -1201,6 +1202,9 @@ options for this method are:
12011202
* ``defaults`` Set to ``false`` to not set ``$search`` properties into the
12021203
created entity.
12031204

1205+
.. versionadded:: 5.2.0
1206+
Support for ``$callback`` as an array of data was added.
1207+
12041208
Creating with an existing primary key
12051209
=====================================
12061210

0 commit comments

Comments
 (0)