Input Validationインストール/アップグレード スクリプト、特にドロップダウンとMaximum Text Lengthフィールドを使用して、Magento の顧客住所属性を更新する方法を知りたいです。

Input Validationインストール/アップグレード スクリプト、特にドロップダウンとMaximum Text Lengthフィールドを使用して、Magento の顧客住所属性を更新する方法を知りたいです。

config.xmlモジュールのセットアップに使用するモデルを指定する必要があります。
//inside <global> node
<resources>
<stackoverflow_question_setup>
<setup>
<module>StackOverflow_Question</module>
<class>Mage_Customer_Model_Entity_Setup</class>
</setup>
</stackoverflow_question_setup>
</resources>
セットアップ スクリプト:
<?php
/* @var $installer Mage_Customer_Model_Entity_Setup */
$installer = $this;
$installer->startSetup();
$data = array(
'input_validation' => 'alpha',//see the values of the input validation dropdown to find out what you can put in here
'max_text_length' => 456
);
$serializedData = serialize($data);
$installer->updateAttribute('customer_address', 'firstname', 'validate_rules', $serializedData);
$installer->endSetup();