Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Access intermediate table data

Hi,

I just started a project using Phalcon (wich I've never used before). I have a many to many relationship in my datas like this :

User : id, name

Game : id, date, score1, score2

UsersGames : id, userid, gameid, team

Everything works fine with my models, but I dont know how to access UserGame.team. How do I do that ?

Thanks.



18.5k
Accepted
answer
edited Nov '14

http://docs.phalconphp.com/es/latest/reference/models.html#relationships-between-models

$user->usersGame->team
$game->usersGame->team;
$usersgame->team;

.