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


PHP CRM_Event_DAO_Event::fetch方法代码示例

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


在下文中一共展示了CRM_Event_DAO_Event::fetch方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: browse

 /**
  * Browse all event templates.
  */
 public function browse()
 {
     //get all event templates.
     $allEventTemplates = array();
     $eventTemplate = new CRM_Event_DAO_Event();
     $eventTypes = CRM_Event_PseudoConstant::eventType();
     $participantRoles = CRM_Event_PseudoConstant::participantRole();
     $participantListings = CRM_Event_PseudoConstant::participantListing();
     //find all event templates.
     $eventTemplate->is_template = TRUE;
     $eventTemplate->find();
     while ($eventTemplate->fetch()) {
         CRM_Core_DAO::storeValues($eventTemplate, $allEventTemplates[$eventTemplate->id]);
         //get listing types.
         if ($eventTemplate->participant_listing_id) {
             $allEventTemplates[$eventTemplate->id]['participant_listing'] = $participantListings[$eventTemplate->participant_listing_id];
         }
         //get participant role
         if ($eventTemplate->default_role_id) {
             $allEventTemplates[$eventTemplate->id]['participant_role'] = $participantRoles[$eventTemplate->default_role_id];
         }
         //get event type.
         if (isset($eventTypes[$eventTemplate->event_type_id])) {
             $allEventTemplates[$eventTemplate->id]['event_type'] = $eventTypes[$eventTemplate->event_type_id];
         }
         //form all action links
         $action = array_sum(array_keys($this->links()));
         //add action links.
         $allEventTemplates[$eventTemplate->id]['action'] = CRM_Core_Action::formLink(self::links(), $action, array('id' => $eventTemplate->id), ts('more'), FALSE, 'eventTemplate.manage.action', 'Event', $eventTemplate->id);
     }
     $this->assign('rows', $allEventTemplates);
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url(CRM_Utils_System::currentPath(), 'reset=1&action=browse'));
 }
开发者ID:nielosz,项目名称:civicrm-core,代码行数:37,代码来源:EventTemplate.php

示例2: deleteSet

 /**
  * Delete the price set.
  *
  * @param int $id
  *   Price Set id.
  *
  * @return bool
  *   false if fields exist for this set, true if the
  *   set could be deleted
  *
  */
 public static function deleteSet($id)
 {
     // remove from all inactive forms
     $usedBy = self::getUsedBy($id);
     if (isset($usedBy['civicrm_event'])) {
         foreach ($usedBy['civicrm_event'] as $eventId => $unused) {
             $eventDAO = new CRM_Event_DAO_Event();
             $eventDAO->id = $eventId;
             $eventDAO->find();
             while ($eventDAO->fetch()) {
                 self::removeFrom('civicrm_event', $eventDAO->id);
             }
         }
     }
     // delete price fields
     $priceField = new CRM_Price_DAO_PriceField();
     $priceField->price_set_id = $id;
     $priceField->find();
     while ($priceField->fetch()) {
         // delete options first
         CRM_Price_BAO_PriceField::deleteField($priceField->id);
     }
     $set = new CRM_Price_DAO_PriceSet();
     $set->id = $id;
     return $set->delete();
 }
开发者ID:rollox,项目名称:civicrm-core,代码行数:37,代码来源:PriceSet.php


注:本文中的CRM_Event_DAO_Event::fetch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。