Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. // Get all modDocuments (resources) with template id 2 (2 = 'Service')
  2.  
  3. // This does not work
  4. $query = $modx->newQuery('modResource');
  5. $query->leftJoin('modTemplate', 'template');
  6. $query->where(array(
  7.     'template.templatename' => 'Service'
  8. ));
  9. $query->sortby('pagetitle', 'ASC');
  10.  
  11. // This does work
  12. $query = $modx->newQuery('modResource');
  13. $query->where(array(
  14.     'template' => 2
  15. ));
  16. $query->sortby('pagetitle', 'ASC');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement