2

I want to go to the declaration of the method with Ctrl + B, but the model is return form a magic method. And there are some similar Model.

What can I do to go to the declaration?

The method has defined on the Order Model

enter image description here

The same as top

enter image description here

Here are Models

enter image description here

the magic method which returns the instance of $name Model

enter image description here

LazyOne
  • 158,824
  • 45
  • 388
  • 391
luohanqun
  • 29
  • 4
  • Declare your `m_order` and alike fields with `@property` tag (in PHPDoc comment for the appropriate class) so they provide correct typehint (what model they return) so that IDE may find the methods that model has. – LazyOne Apr 28 '18 at 09:59
  • Welcome to stack overflow, and kudo's for documenting your question! This is an excellent question. However this question has been asked before, and has some excellent answers here: https://stackoverflow.com/questions/15634021/how-to-document-magic-call-and-callstatic-methods-for-ides I'm voting to close this answer so stack overflow does noet get cluttered with duplicate questions. – Arend Apr 28 '18 at 10:01
  • @LazyOne Thanks, but it does not perfect, because there are `m_order`,'m_student` or more model, it will take me much work to write `@property`, I want to a simpler way, like writing some thing on the `--get($name)` – luohanqun Apr 28 '18 at 11:41
  • @luohanqun Good luck with wishes. PhpStorm supports PHPDoc tags... and they do work _just fine_. I know no other way how it can be described in `__get()`. Maybe another IDE/editor can do .. but not PhpStorm. – LazyOne Apr 28 '18 at 12:28

0 Answers0