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


PHP CRM_Core_BAO_CustomGroup::find方法代码示例

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


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

示例1: createGroup

 /**
  * Helper function to create Custom Group
  *
  * @deprecated - use functions on test case parent class
  *
  * @param $group
  * @param null $extends
  * @param bool $isMultiple
  *
  * @return object of created group
  */
 static function createGroup($group, $extends = NULL, $isMultiple = FALSE)
 {
     if (empty($group)) {
         if (isset($extends) && !is_array($extends)) {
             $extends = array($extends);
         }
         $group = array('title' => 'Test_Group', 'name' => 'test_group', 'extends' => $extends, 'style' => 'Inline', 'is_multiple' => $isMultiple, 'is_active' => 1, 'version' => 3);
     } else {
         // this is done for backward compatibility
         // with tests older than 3.2.3
         if (isset($group['extends']) && !is_array($group['extends'])) {
             $group['extends'] = array($group['extends']);
         }
     }
     $result = civicrm_api('custom_group', 'create', $group);
     if ($result['is_error']) {
         return NULL;
     }
     // this is done for backward compatibility
     // with tests older than 3.2.3
     require_once 'CRM/Core/BAO/CustomGroup.php';
     $group = new CRM_Core_BAO_CustomGroup();
     $group->id = $result['id'];
     $group->find(TRUE);
     return $group;
 }
开发者ID:prashantgajare,项目名称:civicrm-core,代码行数:37,代码来源:Custom.php

示例2: testDeleteGroup

 /**
  * Test deleteGroup.
  */
 public function testDeleteGroup()
 {
     $customGroupTitle = 'My Custom Group';
     $groupParams = array('title' => $customGroupTitle, 'name' => 'my_custom_group', 'style' => 'Tab', 'extends' => 'Individual', 'is_active' => 1);
     $customGroup = $this->customGroupCreate($groupParams);
     $groupObject = new CRM_Core_BAO_CustomGroup();
     $groupObject->id = $customGroup['id'];
     $groupObject->find(TRUE);
     $isDelete = CRM_Core_BAO_CustomGroup::deleteGroup($groupObject);
     // Check it worked!
     $this->assertEquals(TRUE, $isDelete);
     $this->assertDBNull('CRM_Core_DAO_CustomGroup', $customGroup['id'], 'title', 'id', 'Database check for custom group record.');
 }
开发者ID:nielosz,项目名称:civicrm-core,代码行数:16,代码来源:CustomGroupTest.php


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