File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -101,16 +101,16 @@ Datasource
101101 This allows you to create dynamic validation messages based on the entity
102102 state and validation rule options.
103103
104-
105104ORM
106105---
107106
108- - ``CounterCacheBehavior::updateCounterCache() `` has been addded . This method
107+ - ``CounterCacheBehavior::updateCounterCache() `` has been added . This method
109108 allows you to update the counter cache values for all records of the configured
110109 associations.
111110- ``BelongsToMany::setJunctionProperty() `` and ``getJunctionProperty() `` were
112111 added. These methods allow you to customize the ``_joinData `` property that is
113112 used to hydrate junction table records.
113+ - ``Table::findOrCreate() `` now accepts an array as second argument to directly pass data in.
114114
115115View
116116----
Original file line number Diff line number Diff line change @@ -1182,6 +1182,15 @@ ideal in scenarios where you need to reduce the chance of duplicate records::
11821182 }
11831183 );
11841184
1185+ As of 5.2.0, you can provide an array of data to set into the entity when it is
1186+ created::
1187+
1188+ $otherData = ['name' => 'bobbi'];
1189+ $record = $table->findOrCreate(
1190+ ['email' => 'bobbi@example.com'],
1191+ $otherData,
1192+ );
1193+
11851194If your find conditions require custom order, associations or conditions, then
11861195the ``$search `` parameter can be a callable or ``SelectQuery `` object. If you use
11871196a callable, it should take a ``SelectQuery `` as its argument.
@@ -1193,6 +1202,9 @@ options for this method are:
11931202* ``defaults `` Set to ``false `` to not set ``$search `` properties into the
11941203 created entity.
11951204
1205+ .. versionadded :: 5.2.0
1206+ Support for ``$callback `` as an array of data was added.
1207+
11961208Creating with an existing primary key
11971209=====================================
11981210
You can’t perform that action at this time.
0 commit comments