I have created a module and EAV tables for that. Module's tables are very similar to customer_Address
entity and i have defined Attribute AttrA, AttrB and AttrC for this table.
So table structure is very similar to as follows:
+------------------+----------------------+------+-----+---------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------------+----------------------+------+-----+---------------------+----------------+
| entity_id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| entity_type_id | smallint(5) unsigned | NO | | 0 | |
| attribute_set_id | smallint(5) unsigned | NO | | 0 | |
| increment_id | varchar(50) | YES | | NULL | |
| parent_id | int(10) unsigned | YES | MUL | NULL | |
| created_at | timestamp | NO | | 0000-00-00 00:00:00 | |
| updated_at | timestamp | NO | | 0000-00-00 00:00:00 | |
| is_active | smallint(5) unsigned | NO | | 1 | |
+------------------+----------------------+------+-----+---------------------+----------------+
and AttrA, AttrB and AttrC values are stored in tables with respective data type.
Now using the basic syntax, I am able to add value of attributes AttrA, AttrB and AttrC. Which is:
$model = Mage::getModel('customer/address');
$model->setAttrA('ValA')->setAttrB('ValB')->setAttrC('ValC');
doing this correctly sets the values of AttrA, AttrB and AttrC but value of parent_id
in customer_entity
sets to NULL
by default.
Here I want to be able to set the parent_id
to some other value.
For this i tried suggestion given in different post using setParentId(<parent-id-value>)
. Which is not working in my case. Any idea how i can do this?