Created
December 4, 2011 12:35
-
-
Save brankoajzele/1430096 to your computer and use it in GitHub Desktop.
Inchoo_Phonebook Magento Test Extension: app/code/local/Inchoo/Phonebook/Model/Resource/Setup.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_Setup extends Mage_Eav_Model_Entity_Setup { | |
public function getDefaultEntities() { | |
return array( | |
Inchoo_Phonebook_Model_User::ENTITY => array( | |
'entity_model' => 'inchoo_phonebook/user', | |
'table' => 'inchoo_phonebook/user', /* Maps to the config.xml > global > models > inchoo_phonebook_resource > entities > user */ | |
'attributes' => array( | |
'first_name' => array( | |
'type' => 'varchar', | |
'label' => 'First name', | |
'input' => 'text', | |
'required' => true, | |
'sort_order' => 10, | |
'position' => 10, | |
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, | |
), | |
'last_name' => array( | |
'type' => 'varchar', | |
'label' => 'Last name', | |
'input' => 'text', | |
'required' => true, | |
'sort_order' => 20, | |
'position' => 20, | |
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, | |
), | |
'email' => array( | |
'type' => 'varchar', | |
'label' => 'Email', | |
'input' => 'text', | |
'required' => true, | |
'sort_order' => 30, | |
'position' => 30, | |
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, | |
), | |
'address' => array( | |
'type' => 'text', | |
'label' => 'Address', | |
'input' => 'multiline', | |
'sort_order' => 40, | |
'multiline_count' => 2, | |
'validate_rules' => 'a:2:{s:15:"max_text_length";i:255;s:15:"min_text_length";i:1;}', | |
'position' => 40, | |
'required' => false, | |
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, | |
), | |
'is_active' => array( | |
'type' => 'int', | |
'label' => 'Is Active', | |
'input' => 'text', | |
'required' => false, | |
'sort_order' => 50, | |
'position' => 50, | |
'required' => false, | |
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, | |
), | |
) | |
) | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment