We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

How Can I Insert new data with `HasOne` relationship

How Can I Insert new data with HasOne relationship



11.6k
Accepted
answer

create a new instance of your related model, then assign it to your model using the alias you defined in your hasOne relation



6.6k

create a new instance of your related model, then assign it to your model using the alias you defined in your hasOne relation

Thank you.