dmeybohm / chocolate-cakephp

Framework plugin for CakePHP in PhpStorm
MIT License
15 stars 0 forks source link

Handle associated tables better when tables are stored in variables #119

Open dmeybohm opened 1 month ago

dmeybohm commented 1 month ago

For the following syntax, the type providers don't currently support it:

$table = $this->fetchTable('Movies');
$table->Artists->find(..

This is because the we only look for the pattern $this->Movies->Artists.

I think we would need to store the signature of the variable in getType and then resolve it in getBySignature, because we don't know the type of the variable came from fetchTable or another table lookup method without the signature.

dmeybohm commented 1 month ago

Started looking into it in this PR: https://github.com/dmeybohm/chocolate-cakephp/pull/118