當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PageList::getPages方法代碼示例

本文整理匯總了PHP中PageList::getPages方法的典型用法代碼示例。如果您正苦於以下問題:PHP PageList::getPages方法的具體用法?PHP PageList::getPages怎麽用?PHP PageList::getPages使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PageList的用法示例。


在下文中一共展示了PageList::getPages方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: populate

 function populate()
 {
     $tickets = new TicketCollection(new Ticket());
     $pl = new PageList('current_tickets');
     $ticket_sh = new SearchHandler($tickets, false);
     $ticket_sh->setLimit(10);
     $ticket_sh->setOrderBy('created', 'ASC');
     $user = new User();
     $user->loadBy('username', EGS_USERNAME);
     $ticket_sh->addConstraint(new Constraint('originator_person_id', '=', $user->username));
     $ticket_sh->addConstraint(new Constraint('usercompanyid', '=', EGS_COMPANY_ID));
     // Find open statuses
     $statuses = new TicketStatusCollection(new TicketStatus());
     $status_sh = new SearchHandler($statuses);
     $status_sh->addConstraint(new Constraint('usercompanyid', '=', EGS_COMPANY_ID));
     $status_sh->addConstraint(new Constraint('status_code', '=', 'NEW'), 'OR');
     $status_sh->addConstraint(new Constraint('status_code', '=', 'OPEN'), 'OR');
     $statuses->load($status_sh);
     foreach ($statuses->getContents() as $status) {
         $ticket_sh->addConstraint(new Constraint('client_ticket_status_id', '=', $status->id), 'OR');
     }
     $tickets->load($ticket_sh);
     $pl->addFromCollection($tickets, array('module' => 'ticketing', 'controller' => 'tickets', 'action' => 'view'), array('id'), 'ticket', 'summary');
     $this->contents = $pl->getPages()->toArray();
 }
開發者ID:uzerpllp,項目名稱:uzerp,代碼行數:25,代碼來源:MyCurrentTicketsEGlet.php

示例2: populate

 function populate()
 {
     $pl = new PageList('companies_added_today');
     $companies_do = new CompanyCollection(new Company());
     $sh = new SearchHandler($companies_do, false);
     $sh->extract();
     $sh->addConstraint(new Constraint('is_lead', '=', 'false'));
     $sh->addConstraint(new Constraint('created', '>', fix_date(date(DATE_FORMAT))));
     $sh->setLimit(10);
     $companies_do->load($sh);
     $pl->addFromCollection($companies_do, array('module' => 'contacts', 'controller' => 'companys', 'action' => 'view'), array('id'), 'company', 'name');
     $this->contents = $pl->getPages()->toArray();
 }
開發者ID:uzerpllp,項目名稱:uzerp,代碼行數:13,代碼來源:CompaniesAddedTodayEGlet.php

示例3: populate

 function populate()
 {
     $pl = new PageList('open_opportunities');
     $open_opportunities = new OpportunityCollection(new Opportunity());
     $sh = new SearchHandler($open_opportunities, false);
     $sh->extract();
     $sh->addConstraint(new Constraint('owner', '=', EGS_USERNAME));
     $sh->addConstraint(new Constraint('open', '=', 'true'));
     $sh->setLimit(10);
     $sh->setOrderBy('cost', 'DESC');
     $open_opportunities->load($sh);
     $pl->addFromCollection($open_opportunities, array('module' => 'crm', 'controller' => 'opportunitys', 'action' => 'view'), array('id'), 'opportunity', 'name');
     $this->setData($pl->getPages()->toArray());
 }
開發者ID:uzerpllp,項目名稱:uzerp,代碼行數:14,代碼來源:OpenOpportunitiesEGlet.php

示例4: populate

 function populate()
 {
     $pl = new PageList('current_activities');
     $current_activities = new ActivityCollection(new Activity());
     $sh = new SearchHandler($current_activities, false);
     $sh->extract();
     $sh->addConstraint(new Constraint('assigned', '=', EGS_USERNAME));
     $sh->addConstraint(new Constraint('completed', 'IS', 'NULL'));
     $sh->addConstraint(new Constraint('startdate', '<', '(now())'));
     $sh->setLimit(10);
     $sh->setOrderBy('created', 'DESC');
     $current_activities->load($sh);
     $pl->addFromCollection($current_activities, array('module' => 'crm', 'controller' => 'activitys', 'action' => 'view'), array('id'), 'activity', 'name');
     $this->contents = $pl->getPages()->toArray();
 }
開發者ID:uzerpllp,項目名稱:uzerp,代碼行數:15,代碼來源:CurrentActivitiesEGlet.php

示例5: populate

 function populate()
 {
     if (!$this->isCached()) {
         $pl = new PageList('recently_added_leads');
         $companies_do = new CompanyCollection(new Company());
         $sh = new SearchHandler($companies_do, false);
         $sh->extract();
         $sh->addConstraint(new Constraint('is_lead', '=', 'true'));
         $sh->setLimit(10);
         $sh->setOrderBy('created', 'DESC');
         $companies_do->load($sh);
         $pl->addFromCollection($companies_do, array('module' => 'contacts', 'controller' => 'companys', 'action' => 'view'), array('id'), 'company', 'name');
         $this->setCache($pl->getPages()->toArray());
     }
     $this->contents = $this->getCache();
 }
開發者ID:uzerpllp,項目名稱:uzerp,代碼行數:16,代碼來源:RecentlyAddedLeadsEGlet.php

示例6: populate

 function populate()
 {
     $pl = new PageList('my_tickets');
     $my_tickets = new TicketCollection(new Ticket());
     $sh = new SearchHandler($my_tickets, false);
     $sh->extract();
     $sh->addConstraint(new Constraint('assigned_to', 'IS', 'NULL'));
     $cc = new ConstraintChain();
     $cc->add(new Constraint('internal_status_code', '=', 'NEW'), 'OR');
     $cc->add(new Constraint('internal_status_code', '=', 'OPEN'), 'OR');
     $sh->addConstraintChain($cc);
     $sh->setLimit(10);
     $sh->setOrderBy('created', 'DESC');
     $my_tickets->load($sh);
     $pl->addFromCollection($my_tickets, array('module' => 'ticketing', 'controller' => 'tickets', 'action' => 'view'), array('id'), 'ticket', 'summary');
     $this->contents = $pl->getPages()->toArray();
 }
開發者ID:uzerpllp,項目名稱:uzerp,代碼行數:17,代碼來源:UnassignedTicketsEGlet.php

示例7: populate

 function populate()
 {
     $pl = new PageList('my_customers');
     $customers = new SLCustomerCollection(new SLCustomer());
     //	Either get data from a function that returns a collection
     //		$customers->getUnassignedCompanies();
     // Or construct a collection from a sql query
     $db = DB::Instance();
     $query = 'select id, * from slmaster where usercompanyid=' . EGS_COMPANY_ID . ' limit 10';
     $results = $db->getAssoc($query);
     foreach ($results as $id => $row) {
         $customer = new SLCustomer();
         $customer->_data = $row;
         $customer->load($id);
         $customer->id = $id;
         $customers->add($customer);
     }
     $pl->addFromCollection($customers, array('module' => 'sales_ledger', 'controller' => 'slcustomers', 'action' => 'view'), array('id'), '', 'name');
     $this->contents = $pl->getPages()->toArray();
 }
開發者ID:uzerpllp,項目名稱:uzerp,代碼行數:20,代碼來源:CustomerEGlet.php


注:本文中的PageList::getPages方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。