Open mmethner opened 5 years ago
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.
public static function relations()
Unfortunately I don't know the answer to that, but I don't think so....
Hello, I know the way how to use hasMany() if there is a database relation like
Accessing it, would look like this.
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:
Is this possible? So the final target is to access the relation through the common
public static function relations()
method in the Entity class.