문제

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..

도움이 되었습니까?

해결책

@Tirth Patel I think you should create separate model as well as Resource file for another db table.

다른 팁

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

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top