Skip to content

Instantly share code, notes, and snippets.

@brankoajzele
Created December 4, 2011 12:34
Show Gist options
  • Save brankoajzele/1430091 to your computer and use it in GitHub Desktop.
Save brankoajzele/1430091 to your computer and use it in GitHub Desktop.
Inchoo_Phonebook Magento Test Extension: app/code/local/Inchoo/Phonebook/Model/Resource/User/Collection.php
<?php
class Inchoo_Phonebook_Model_Resource_User_Collection extends Mage_Eav_Model_Entity_Collection_Abstract
{
protected function _construct()
{
$this->_init('inchoo_phonebook/user');
}
protected function _initSelect()
{
$this->getSelect()->from(array('e' => $this->getEntity()->getEntityTable()));
if ($this->getEntity()->getTypeId()) {
/**
* We override the Mage_Eav_Model_Entity_Collection_Abstract->_initSelect()
* because we want to remove the call to addAttributeToFilter for 'entity_type_id'
* as it is causing invalid SQL select, thus making the User model load failing.
*/
//$this->addAttributeToFilter('entity_type_id', $this->getEntity()->getTypeId());
}
return $this;
}
}
@bennnie
Copy link

bennnie commented Oct 22, 2012

Css failed at http://inchoo.net/ecommerce/magento/creating-an-eav-based-models-in-magento/, i used a quick css fix. Probably wrong divs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment