After setting up a relation (Defining a relation), you can easily get the related records of a record in this simple way:
Set up the following relation on the “Blog” content type:
relations : post_comments : type : 1-n with : Comments from : id_record to : post_id
or using XML:
<relation name="post_comments" type="1-n" with="Comments" from="id_record" to="post_id" />
Then, access the comments of a post like this:
$comments = $post->related('post_comments');
More informations: Defining a relation.
Back to YAML/XML Schemes.