3 edited title
source | link

Magento 2 - Can I have to create API, Interface & Resource Model for relationrelational table

I am creating a module which have three tables let's say for example

table1
--------
id int(13) PRIMARY_KEY
title varchar(50)

table2
--------
id int(13) PRIMARY_KEY
title varchar(255)

table3 `relational_table`
--------
table1_id int(13) (foreign key of table1)
table2_id int(13) (foreign key of table2)

For table1 and table2 I have defined everything like Interface, API, Resource Model.

So my main concern is
Should I have to create PRIMARY_KEY for table3 ?
Should I have to create Resource Model, Interface, API for table3

If YES then whyhow many things needed? and NO then how crud operation will be perform for maintaining relation?

I have referenced magento core module module-tax for tax_rate to tax_rule they have five tables and maintaining all relation.

Magento 2 Can I have to create API, Interface & Resource Model for relation table

I am creating a module which have three tables let's say for example

table1
--------
id int(13) PRIMARY_KEY
title varchar(50)

table2
--------
id int(13) PRIMARY_KEY
title varchar(255)

table3 `relational_table`
--------
table1_id int(13) (foreign key of table1)
table2_id int(13) (foreign key of table2)

For table1 and table2 I have defined everything like Interface, API, Resource Model.

So my main concern is
Should I have to create PRIMARY_KEY for table3 ?
Should I have to create Resource Model, Interface, API for table3

If YES then why? and NO then how crud operation will be perform for maintaining relation?

I have referenced magento core module module-tax for tax_rate to tax_rule they have five tables and maintaining all relation.

Magento 2 - Can I have to create API, Interface & Resource Model for relational table

I am creating a module which have three tables let's say for example

table1
--------
id int(13) PRIMARY_KEY
title varchar(50)

table2
--------
id int(13) PRIMARY_KEY
title varchar(255)

table3 `relational_table`
--------
table1_id int(13) (foreign key of table1)
table2_id int(13) (foreign key of table2)

For table1 and table2 I have defined everything like Interface, API, Resource Model.

So my main concern is
Should I have to create PRIMARY_KEY for table3 ?
Should I have to create Resource Model, Interface, API for table3

If YES then how many things needed? and NO then how crud operation will be perform for maintaining relation?

I have referenced magento core module module-tax for tax_rate to tax_rule they have five tables and maintaining all relation.

2 deleted 2 characters in body
source | link

I am creating a module which have three tables let's say for example

table1
--------
id int(13) PRIMARY_KEY
title varchar(50)

table2
--------
id int(13) PRIMARY_KEY
title varchar(255)

table3 `relational_table`
--------
table1_id int(13) (foreign key of table1)
table2_id int(13) (foreign key of table2)

For table1 and table2 I have defined everything like Interface, API, Resource Model.

So my main concern is
Should I have to create PRIMARY_KEY for table3 ?
Should I have to create Resource Model, Interface, API for table3

If YES then why? and NO then how? crud operation will be perform for maintaining relation??

I have referenced magento core module module-tax for tax_rate to tax_rule they have five tables and maintaining all relation.

I am creating a module which have three tables let's say for example

table1
--------
id int(13) PRIMARY_KEY
title varchar(50)

table2
--------
id int(13) PRIMARY_KEY
title varchar(255)

table3 `relational_table`
--------
table1_id int(13) (foreign key of table1)
table2_id int(13) (foreign key of table2)

For table1 and table2 I have defined everything like Interface, API, Resource Model.

So my main concern is
Should I have to create PRIMARY_KEY for table3 ?
Should I have to create Resource Model, Interface, API for table3

If YES then why? and NO then how? crud operation will be perform for maintaining relation??

I have referenced magento core module module-tax for tax_rate to tax_rule they have five tables and maintaining all relation.

I am creating a module which have three tables let's say for example

table1
--------
id int(13) PRIMARY_KEY
title varchar(50)

table2
--------
id int(13) PRIMARY_KEY
title varchar(255)

table3 `relational_table`
--------
table1_id int(13) (foreign key of table1)
table2_id int(13) (foreign key of table2)

For table1 and table2 I have defined everything like Interface, API, Resource Model.

So my main concern is
Should I have to create PRIMARY_KEY for table3 ?
Should I have to create Resource Model, Interface, API for table3

If YES then why? and NO then how crud operation will be perform for maintaining relation?

I have referenced magento core module module-tax for tax_rate to tax_rule they have five tables and maintaining all relation.

1
source | link

Magento 2 Can I have to create API, Interface & Resource Model for relation table

I am creating a module which have three tables let's say for example

table1
--------
id int(13) PRIMARY_KEY
title varchar(50)

table2
--------
id int(13) PRIMARY_KEY
title varchar(255)

table3 `relational_table`
--------
table1_id int(13) (foreign key of table1)
table2_id int(13) (foreign key of table2)

For table1 and table2 I have defined everything like Interface, API, Resource Model.

So my main concern is
Should I have to create PRIMARY_KEY for table3 ?
Should I have to create Resource Model, Interface, API for table3

If YES then why? and NO then how? crud operation will be perform for maintaining relation??

I have referenced magento core module module-tax for tax_rate to tax_rule they have five tables and maintaining all relation.