netz98/n98-magerun — pull request #379 by SchumacherFM (2014-08-10 22:51:15+00:00)
Title: [FEATURE] new command dev:module:model:method ... 

... which reads all column names from a model related MySQL table and writes those column into the corresponding .php file.

File before:

![gs_01_before](https://cloud.githubusercontent.com/assets/372027/3792103/03ba7560-1b66-11e4-9798-b6e4cafc93dd.png)

File after:

![gs_02_after](https://cloud.githubusercontent.com/assets/372027/3792104/03bd164e-1b66-11e4-80fa-33f059244cc3.png)

Where the feature pays out:

![gs_03](https://cloud.githubusercontent.com/assets/372027/3792119/e24a4db4-1b66-11e4-9fd1-728a4d9298e6.png)

If something is weird let me know and I'll fix it.

That core file is just an example!

The method uses internally `Mage::getModel()` to load the model and then uses a Varien_Autoloader method to figure out the correct include path: local -> community -> core.

E.g. if you have rewritten the Mage_Sitemap_Model_Sitemap in your local namespace with some more columns then it would modify the local file and not the core file. And if you have a custom model then this new feature method will write into that custom model file.