magento 2 : model in custom module
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
1
down vote
favorite
i already have a table in database also created model files and all works fine so now added another table successfully so what changes i need to do with model files
i mean in model resourcemodel and connection files..
magento2
New contributor
Tirth Patel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
1
down vote
favorite
i already have a table in database also created model files and all works fine so now added another table successfully so what changes i need to do with model files
i mean in model resourcemodel and connection files..
magento2
New contributor
Tirth Patel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Have you got solution? or you have any concern.
– Chirag Patel
3 mins ago
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
i already have a table in database also created model files and all works fine so now added another table successfully so what changes i need to do with model files
i mean in model resourcemodel and connection files..
magento2
New contributor
Tirth Patel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
i already have a table in database also created model files and all works fine so now added another table successfully so what changes i need to do with model files
i mean in model resourcemodel and connection files..
magento2
magento2
New contributor
Tirth Patel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Tirth Patel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Tirth Patel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 30 mins ago
Tirth Patel
706
706
New contributor
Tirth Patel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Tirth Patel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Tirth Patel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Have you got solution? or you have any concern.
– Chirag Patel
3 mins ago
add a comment |Â
Have you got solution? or you have any concern.
– Chirag Patel
3 mins ago
Have you got solution? or you have any concern.
– Chirag Patel
3 mins ago
Have you got solution? or you have any concern.
– Chirag Patel
3 mins ago
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
0
down vote
accepted
@Tirth Patel
I think you should create separate model as well as Resource file for another db table.
it works thanks @sagar
– Tirth Patel
8 mins ago
add a comment |Â
up vote
4
down vote
You need to add another resource modal connection (CRUD)
Step : 1 Create Model
app/code/NameSpace/ModuleName/Model/Post.php
Step : 2 Create Resource Model
app/code/NameSpace/ModuleName/Model/ResourceModel/Post.php
Step : 3 Create Resource Model Collection - Get Model Collection
app/code/NameSpace/ModuleName/Model/ResourceModel/Post/Collection.php
After this please run this command line:
php bin/magento setup:upgrade
php bin/magento C:F
add a comment |Â
up vote
1
down vote
do same process for your second table what you have done for your first table. i mean create diffrent model,resource file
for your second table.
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
@Tirth Patel
I think you should create separate model as well as Resource file for another db table.
it works thanks @sagar
– Tirth Patel
8 mins ago
add a comment |Â
up vote
0
down vote
accepted
@Tirth Patel
I think you should create separate model as well as Resource file for another db table.
it works thanks @sagar
– Tirth Patel
8 mins ago
add a comment |Â
up vote
0
down vote
accepted
up vote
0
down vote
accepted
@Tirth Patel
I think you should create separate model as well as Resource file for another db table.
@Tirth Patel
I think you should create separate model as well as Resource file for another db table.
answered 28 mins ago


sagar nakrani
496
496
it works thanks @sagar
– Tirth Patel
8 mins ago
add a comment |Â
it works thanks @sagar
– Tirth Patel
8 mins ago
it works thanks @sagar
– Tirth Patel
8 mins ago
it works thanks @sagar
– Tirth Patel
8 mins ago
add a comment |Â
up vote
4
down vote
You need to add another resource modal connection (CRUD)
Step : 1 Create Model
app/code/NameSpace/ModuleName/Model/Post.php
Step : 2 Create Resource Model
app/code/NameSpace/ModuleName/Model/ResourceModel/Post.php
Step : 3 Create Resource Model Collection - Get Model Collection
app/code/NameSpace/ModuleName/Model/ResourceModel/Post/Collection.php
After this please run this command line:
php bin/magento setup:upgrade
php bin/magento C:F
add a comment |Â
up vote
4
down vote
You need to add another resource modal connection (CRUD)
Step : 1 Create Model
app/code/NameSpace/ModuleName/Model/Post.php
Step : 2 Create Resource Model
app/code/NameSpace/ModuleName/Model/ResourceModel/Post.php
Step : 3 Create Resource Model Collection - Get Model Collection
app/code/NameSpace/ModuleName/Model/ResourceModel/Post/Collection.php
After this please run this command line:
php bin/magento setup:upgrade
php bin/magento C:F
add a comment |Â
up vote
4
down vote
up vote
4
down vote
You need to add another resource modal connection (CRUD)
Step : 1 Create Model
app/code/NameSpace/ModuleName/Model/Post.php
Step : 2 Create Resource Model
app/code/NameSpace/ModuleName/Model/ResourceModel/Post.php
Step : 3 Create Resource Model Collection - Get Model Collection
app/code/NameSpace/ModuleName/Model/ResourceModel/Post/Collection.php
After this please run this command line:
php bin/magento setup:upgrade
php bin/magento C:F
You need to add another resource modal connection (CRUD)
Step : 1 Create Model
app/code/NameSpace/ModuleName/Model/Post.php
Step : 2 Create Resource Model
app/code/NameSpace/ModuleName/Model/ResourceModel/Post.php
Step : 3 Create Resource Model Collection - Get Model Collection
app/code/NameSpace/ModuleName/Model/ResourceModel/Post/Collection.php
After this please run this command line:
php bin/magento setup:upgrade
php bin/magento C:F
answered 18 mins ago


Chirag Patel
1,466119
1,466119
add a comment |Â
add a comment |Â
up vote
1
down vote
do same process for your second table what you have done for your first table. i mean create diffrent model,resource file
for your second table.
add a comment |Â
up vote
1
down vote
do same process for your second table what you have done for your first table. i mean create diffrent model,resource file
for your second table.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
do same process for your second table what you have done for your first table. i mean create diffrent model,resource file
for your second table.
do same process for your second table what you have done for your first table. i mean create diffrent model,resource file
for your second table.
answered 14 mins ago


balwant
546
546
add a comment |Â
add a comment |Â
Tirth Patel is a new contributor. Be nice, and check out our Code of Conduct.
Tirth Patel is a new contributor. Be nice, and check out our Code of Conduct.
Tirth Patel is a new contributor. Be nice, and check out our Code of Conduct.
Tirth Patel is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f244542%2fmagento-2-model-in-custom-module%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Have you got solution? or you have any concern.
– Chirag Patel
3 mins ago