Sackling
Sackling

Reputation: 1820

Magento PhpStorm "method not found in class"

I just started to use PhpStorm and I am also not very familiar with Magento but just starting out.

Anyhow after getting all setup with git, my dev server and local database I am getting a lot of the errors: "Referenced method is not found in subject class".

This is not for all methods.. but it does seem to be a large portion of them.

What is causing this?

Some example methods: getProductUrl, getName, productAttribute, getRatingSummary, and on and on.

Upvotes: 0

Views: 907

Answers (1)

Jona
Jona

Reputation: 1156

You should look to http://magicento.com/

This plugin will enable more autocompletion for Magento.

But there's some magic methods that not exists in the code, and of course, will no be clickable.

This plugins enables autocompletion in more than only just methods, it will enable it for templates names (in setTemplate), layout.xml block types, controller actions and more....

A must have when coding for Magento with phpStorm.

Basically, i will take a simple exemple, your IDE is not able to follow a model instansiation like this one:

$product = Mage::getModel('catalog/product')->load($productId);

When you do this, your IDE don't know that $product is an instance of Mage_Catalog_Model_Product. It should look into config.xml to resolve the classname. And so, you can't follow product methods.

Magicento enables this behavior.

Upvotes: 2

Related Questions