public findOrCreate ( array | |
||
$search | array | |
The criteria to find existing records by. Note that when you pass a query object you'll have to use the 2nd arg of the method to modify the entity data before saving. |
$callback | callable | A callback that will be invoked for newly created entities. This callback will be called *before* the entity is persisted. |
$options | array | The options to use when saving. |
return | Cake\Datasource\EntityInterface | An entity. |