0

i have in database one table, her data can be related with many tables, and i am using table below. enter image description here

Columns:

  • object - class name of the related model,
  • object_id - her id,
  • reason_id - id of the row in dictionary,
  • comment - text decription

How to write this relation, using hasMany() and viaTable() methods ?

1 Answer 1

1

I think, you are searching something like this: https://github.com/samdark/yii2-cookbook/blob/master/book/ar-single-table-inheritance.md

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.