Advertisement
amjithps

Untitled

May 17th, 2014
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. ClassRegistry::init("Website")->recursive = 0;
  2.         $this->paginate = array(
  3.                                     "fields"    => "Website.id, Website.title, Website.url, Website.display_image, Website.founder",
  4.                                     "contain"   => array(
  5.                                                             "Rating" => array(
  6.                                                                                 "fields" => "SUM(Rating.score) as total, COUNT(*) as count",
  7.                                                                                 "conditions" => array("Rating.website_id" => "Website.id"),
  8.                                                                             ),
  9.                                                             "Country" => array("fields" => "Country.name"),
  10.                                                             "WebsitesCategory"
  11.                                                         ),
  12.                                     "order"     => "field(Website.id, $user_cat_list) DESC",
  13.                                     "limit"     => 15,
  14.                                 );
  15.         $websites = $this->Paginator->paginate("Website");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement