Skip to content

Commit

Permalink
add get() named arguments example
Browse files Browse the repository at this point in the history
  • Loading branch information
LordSimal committed Aug 7, 2023
1 parent 26e981b commit fc5df9f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions en/appendices/5-0-migration-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Cache
Console
-------

- ``BaseCommand::__constructor()`` was removed.
- ``ConsoleIntegrationTestTrait::useCommandRunner()`` was removed since it's no longer needed.
- ``Shell`` has been removed and should be replaced with `Command <https://book.cakephp.org/5/en/console-commands/commands.html>`__
- ``BaseCommand`` now emits ``Command.beforeExecute`` and
Expand Down Expand Up @@ -312,6 +313,22 @@ The finder can then be called as ``find('byCategoryOrUser', userId: $somevar)``.
You can even include the special named arguments for setting query clauses.
``find('byCategoryOrUser', userId: $somevar, conditions: ['enabled' => true])``.

A similar change has been applied to the ``RepositoryInterface::get()`` method::

public function view(int $id)
{
$entity = $this->Authors->get($id, [
'contain' => ['Books'],
'finder' => 'latest'
]);
}
should now be written as::

public function view(int $id)
{
$entity = $this->Authors->get($id, contain: ['Books'], finder: 'latest');
}

Http
----

Expand Down

0 comments on commit fc5df9f

Please sign in to comment.