I'm creating a simple module that contains two tables named:
I'm having a difficult time joining
city_faq_section. Each time I try to do so, I receive the following error:
Can't retrieve entity config: city_faq/city_faq_section.
After a few hours of debugging, it appears that the problem may stem from the model calling the collection,
City_Faq_Model_Faq. In its constructor, I have
$this->_init('city_faq/faq');, but this may not be correct. Would this cause the above error?
Here is my join call:
/** $this refers to City_Faq_Model_Resource_Faq_Collection **/ $this->join( array('sections' => $this->getTable('section')), 'main_table.section_id = sections.section_id', array('sections.*') ) ->setOrder('sections.sort', self::SORT_ORDER_ASC) ->setOrder('main_table.sort', self::SORT_ORDER_ASC);
Clearly, I'm choking on
$this->getTable('section') - however, if add the following right above the join call, I see the correct table in the log file (
city_faq_section), so it appears that the config is read correctly.
The pertinent section of my config.xml looks like this:
<config> <modules> <City_Faq> <version>0.2.0</version> </City_Faq> </modules> <global> <helpers> <city_faq> <class>City_Faq_Helper</class> </city_faq> </helpers> <models> <city_faq> <class>City_Faq_Model</class> <resourceModel>city_faq_resource</resourceModel> </city_faq> <city_faq_resource> <class>City_Faq_Model_Resource</class> <entities> <faq> <table>city_faq</table> </faq> <section> <table>city_faq_section</table> </section> </entities> </city_faq_resource> </models> <blocks> <city_faq> <class>City_Faq_Block</class> </city_faq> </blocks> <resources> <city_faq_setup> <setup> <module>City_Faq</module> </setup> <connection> <use>core_setup</use> </connection> </city_faq_setup> </resources> </global> </config>
Both tables (
city_faq_section) exist. I'm sure I'm missing something silly. What's interesting, is when completing the join call, the class
City_Faq_Model_Resource_Faq is instantiated but
City_Faq_Model_Resource_Section is not. This leads me to believe that this is the issue.
Things I've tried
- I've tried
- I've even tried setting directly via
-City -Faq -Model -Resource - Faq . Collection.php . Faq.php . Section.php . Faq.php . Section.php -sql -ciy_faq_setup . mysql4-install-0.2.0.php -etc . config.xml