Guest User

Untitled

a guest
Jun 18th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. <?php
  2. // Fetch #1.
  3. $addonIds = $this->Addon->getAddonsFromCollection($collection['Collection']['id']);
  4.  
  5. // Fetch #2.
  6. $conditions = array('Addon.id' => $addonIds);
  7. $opts = array('sort' => 7);
  8. // There's a count in here.
  9. list($order, $limit, $page) = $this->Pagination->init($conditions, array(), $opts);
  10. $pagedAddons = $this->Addon->findAll($conditions, "Addon.id", $order, $limit, $page);
  11.  
  12. // Fetch #3!
  13. foreach ($pagedAddons as $addon) $pagedIds[] = $addon['Addon']['id'];
  14. $addons = $this->Addon->getAddonList($pagedIds,array(
  15. 'all_tags', 'authors', 'compatible_apps', 'files', 'latest_version',
  16. 'list_details'));
Add Comment
Please, Sign In to add comment