Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $installer = $this;
- $installer->startSetup();
- $installer->run("
- DROP TABLE IF EXISTS {$this->getTable('customer_manager')};
- CREATE TABLE {$this->getTable('customer_manager')} (
- `manager_id` int(11) unsigned NOT NULL auto_increment,
- `title` varchar(255) NOT NULL default '',
- `email` varchar(255) NOT NULL default '',
- `password` varchar(255) NOT NULL default '',
- `parentuser_id` int(11) NOT NULL default ''
- PRIMARY KEY (`manager_id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- ");
- $installer->endSetup();
- class Excellence_Manager_Model_Entity_Customer extends Mage_Customer_Model_Resource_Customer {
- public function loadByUsername(Mage_Customer_Model_Customer $customer, $username)
- {
- try {
- $select = $this->_getReadAdapter()->select()
- ->from(array('c' => $this->getEntityTable()), array($this->getEntityIdField()))
- ->joinNatural(array('cev' => $this->getTable('customer_entity_varchar')))
- ->joinNatural(array('ea' => $this->getTable('eav/attribute')))
- ->joinLeft(array('mn' => $this->getTable('customer_manager')), 'mn.parentuser_id=c.entity_id')
- ->where('ea.attribute_code='username' AND cev.value=?',$username);
- }catch(Exception $ex)
- {
- echo $ex;
- }
- $this->load($customer, $id);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement