NotOrm a Join, da sa napisat dotaz aj nativne v SQL?
Upozornění: Tohle vlákno je hodně staré a informace nemusí být platné pro současné Nette.
- Hachik
- Člen | 10
zdravim, pomozte mi prosim prelozit tento dotaz do NotOrm
SELECT
a.access as access,
ro.key_name as role,
re.key_name as resource,
p.key_name as privilege
FROM gui_acl a
JOIN gui_acl_roles ro ON (a.role_id = ro.id)
LEFT JOIN gui_acl_resources re ON (a.resource_id = re.id)
LEFT JOIN gui_acl_privileges p ON (a.privilege_id = p.id)
ORDER BY a.id ASC
alebo da sa nejako spustit iba tak ako je?
- gawan
- Člen | 110
<?php
foreach ($notorm->gui_acl()->order('id') as $acl) {
echo $acl['access'] . ","
. $acl->qui_acl_roles['key_name'] . ","
. $acl->gui_acl_resources['key_name'] . ","
. $acl->gui_acl_privileges['key_name'] . "\n";
}
?>
ak to nechápeš, naštuduj si dokumentáciu k notorm
alebo ak nechceš notorm, tak môžeš použiť priamo PDO.