-
Notifications
You must be signed in to change notification settings - Fork 99
Open
Labels
Description
Hello, I know the way how to use hasMany() if there is a database relation like
table articles \Entity\Articles
articles.id = 1
articles.text = ...
table comments \Entity\Comments
comments.id= 2
comments.article_id = 1
comments.text = ...
Accessing it, would look like this.
$mapper->hasMany(
$entity,
'\Entity\Comments',
'article_id'
),
What I want to do is, accessing the related table through a member of the original table (not through a mapping table with HasManyThrough()). So the layout looks like this:
table articles \Entity\Articles
articles.id = 1
**articles.comment_ids = '["1","6"]'**
articles.text = ...
table comments \Entity\Comments
comments.id= 2
comments.text = ...
Is this possible?
So the final target is to access the relation through the common public static function relations() method in the Entity class.