Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Doctrine] Fetch automatically is disabled in 7.1#20193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
MrYamous wants to merge2 commits intosymfony:7.1
base:7.1
Choose a base branch
Loading
fromMrYamous:doctrine/20180-doctrine-auto-fetching
Open
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 8 additions & 19 deletionsdoctrine.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -677,27 +677,16 @@ will automatically fetch them::
{
}

/**
* Perform a findOneBy() where the slug property matches {slug}.
*/
#[Route('/product/{slug}')]
public function showBySlug(Product $product): Response
{
}
Automatic fetching works if ``{id}`` is in your route, then this is used to
fetch by primary key via the ``find()`` method.

Automatic fetching works in these situations:

* If ``{id}`` is in your route, then this is used to fetch by
primary key via the ``find()`` method.

* The resolver will attempt to do a ``findOneBy()`` fetch by using
*all* of the wildcards in your route that are actually properties
on your entity (non-properties are ignored).
.. versionadded:: 7.1

This behavior is enabled by default on all controllers. If you prefer, you can
restrict this feature to only work on route wildcards called ``id`` to look for
entities by primary key. To do so, set the option
``doctrine.orm.controller_resolver.auto_mapping`` to ``false``.
Prior to Symfony 7.1, automatic fetching was enabled on *all* of the
of the wildcards in your route that are actually properties on your entity.
This behavior is now disabled by default to only work on route wildcards
called ``id``. To do so, set the option
``doctrine.orm.controller_resolver.auto_mapping`` to ``true``.

When ``auto_mapping`` is disabled, you can configure the mapping explicitly for
any controller argument with the ``MapEntity`` attribute. You can even control
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp