Disable MVC model warnings in phpStorm
In CakePHP in my controller classes i declare models like this:
public $uses = array('Mydata');
But when i use this:
$r = $this->Userdata->find('all', $params);
phpStorm gives warnings:
Field 'Userdata' not found in class AppController
When I add this warnings for class name disappears:
// /**
// * Userdata
// * @var Userdata
// */
var $Userdata;
But now, when I try to go to declaration of "Userdata" class, IDE can't find the class which is in the one of the folders of project.
Also IDE gives warnings for **find** method. But **find** is a function in base class of Userdata class.
How can i disable this warning without suppressing all warnings.
Thank you
请先登录再写评论。
Hi ben,
In your class, declare it via @propery tag of PHPDoc comment block
P.S.
Somehow related -- http://devnet.jetbrains.net/thread/435925
@Andriy thank you.
That helps for class name warnings but method warnings still remain.
$r = $this->Userdata->find('all', $params) ;
Do I miss something?
I added this:
Structure is like this:
See my last comment (point #1) in related thread -- backup your project first and try renaming core class Object to something else (e.g. ObjectCakePHP or whatever).
If the above will not help -- please provide some sample project (all files must be included) where the issue appears for your (so I can try reproducing/digging into it here).
Possible duplicate of:
http://devnet.jetbrains.net/message/5466856