Hi guys
I'm trying to move most of my code to PHQL from native SQL, but I have troubel decoding the Docs :)
Lets say I have this simple SQL with a few joins:
SELECT m.team_a_name, m.team_b_name, m.id,ta.name,tb.name, s.id,s.ip,s.con
FROM matches m, servers s, teams ta, teams tb
WHERE m.start=1 AND m.team_a_name=ta.name AND m.team_b_name=tb.name AND m.server_id=s.id;
Lets say I ant to run this outside of a controller or view. If I understand I use Query like this:
$phql= new Query("SELECT m.team_a_name, m.team_b_name, m.id,ta.name,tb.name, s.id,s.ip,s.con
FROM matches AS m, servers AS s, teams AS ta, teams AS tb
WHERE m.start=1 AND m.team_a_name=ta.name AND m.team_b_name=tb.name AND m.server_id=s.id");
m.server_id belongs to s.id.
First of I'm not sure if this works since I can't get it to work as i want to. How does PHQL handle the joins or do I explicitly need to use JOIN of any kind?
Secondly in the documents frequently uses:
$this->modelsManager->createQuery
I fail to see the difference
Regards André