Since Phalcon doesnt have an option to join tables from the model instead querying the table you want (on the fly) I needed (for performance reasons) for phalcon to join a table straight away.
My code
public static function getServers($userid)
{
return (new self)->getModelsManager()->createBuilder()->from('Users')
->where("Users.id = :userid:")
->join("Servers", "Users.id = server.owned_by", "server")
->getQuery()->execute(['userid' => $userid]);
}
Then when I try to access $user[0]->server
There is no property $server
set, How can i access these joined tables?
Or is there a better way for me join the servers table onto the users table in the first query