当前位置: 首页>>代码示例>>PHP>>正文


PHP PageList::addFromCollection方法代码示例

本文整理汇总了PHP中PageList::addFromCollection方法的典型用法代码示例。如果您正苦于以下问题:PHP PageList::addFromCollection方法的具体用法?PHP PageList::addFromCollection怎么用?PHP PageList::addFromCollection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PageList的用法示例。


在下文中一共展示了PageList::addFromCollection方法的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::addFromCollection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。