Created
December 4, 2011 12:34
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Css failed at http://inchoo.net/ecommerce/magento/creating-an-eav-based-models-in-magento/, i used a quick css fix. Probably wrong divs.