mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Document "magic finder" calls in more comprehensive and referenceable way #6107
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @olberger on GitHub (Nov 20, 2018).
Bug Report
(resubmitted from previous attempt badly filed under https://github.com/doctrine/doctrine-website-build-prod/issues/2)
Summary
The findBy* "magic" finder methods would deserve a better and more explicit documentation, which would also deserve a referenceable anchor (for pointing to it from other docs, like Symfony's, etc.).
Current behavior
The docs mention that "An EntityRepository also provides a mechanism for more concise calls through its use of __call" (later the code mentions the "__call magic"), in
https://www.doctrine-project.org/projects/doctrine-orm/en/latest/reference/working-with-objects.html#entities-and-the-identity-map
The mechanism isn't really documented, and is just given as an example.
https://www.doctrine-project.org/api/orm/2.7/Doctrine/ORM/EntityRepository.html#method___call is rather sybylline ins this respect too: "Adds support for magic method calls."
Expected behavior
The docs should give such findBy* "magic" methods some name, and some more explicit reference point so that one can point to it, either to recommend, or to warn against their use.
Thanks in advance.