I have Magento with Fishpig_Wordpress module. I've created some new postmeta data for posts, that is saved at postmeta table. I just saw that Fishpig has a custom load SQL method in /Model/Mysql4/Post.php..
protected function _getLoadSelect($field, $value, $object)
{
$select = $this->_getReadAdapter()->select()
->from(array('e' => $this->getMainTable()))
->where("e.{$field}=?", $value);
if (Mage::getDesign()->getArea() == 'frontend') {
if (Mage::helper('wordpress/plugin_allInOneSeo')->isEnabled()) {
foreach(Mage::helper('wordpress/plugin_allInOneSeo')->getMetaFields() as $field) {
$table = 'aioseop_'.$field;
$select->joinLeft(
array($table => Mage::helper('wordpress/db')->getTableName('postmeta')),
"{$table}.post_id = e.ID AND ".$this->_getReadAdapter()->quoteInto("{$table}.meta_key=?", "_aioseop_{$field}"),
array('meta_'.$field => 'meta_value')
);
}
}
}
$select->limit(1);
return $select;
}
That uses the Mage::helper('wordpress/db')->getTableName('postmeta') in the joinLeft method. But I don't know how if I should use the _getLoadSelect protected method or create another class to call the postmeta table.
So, the question is: Is there a way to get data from postmeta table with Fishpix module or I need to create a new class for this?