Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Action:
- $this->results = Doctrine_Query::create()
- ->select('u.*, p.name, p.sort_key')
- ->from('Users u')
- ->leftJoin('u.UserPermission up')
- ->leftJoin('up.Permission p')
- ->where('u.user_id = ?')
- ->orderBy('p.sort_key')
- ->execute(array('1010'));
- -------------------------------------
- Template:
- <?php foreach($results AS $result): ?>
- <strong><?php echo $result->get('first_name'); ?> <?php echo $result->get('last_name'); ?></strong><br />
- <br />
- <ul>
- <?php foreach($result->UserPermission AS $upermission): ?>
- <li><?php echo $upermission->Permission->get('name'); ?></li>
- <?php endforeach; ?>
- </ul>
- <?php endforeach;?>
Add Comment
Please, Sign In to add comment