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


PHP CRM_Financial_BAO_FinancialAccount::validateTogglingDeferredRevenue方法代码示例

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


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

示例1: testValidateTogglingDeferredRevenue

 /**
  * Test Validate if Deferred Account is set for Financial Type.
  */
 public function testValidateTogglingDeferredRevenue()
 {
     $orgContactID = $this->organizationCreate();
     //create relationship
     $params = array('name_a_b' => 'Relation 1', 'name_b_a' => 'Relation 2', 'contact_type_a' => 'Individual', 'contact_type_b' => 'Organization', 'is_reserved' => 1, 'is_active' => 1);
     $relationshipTypeId = $this->relationshipTypeCreate($params);
     $ids = array();
     $params = array('name' => 'test type', 'domain_id' => 1, 'description' => NULL, 'minimum_fee' => 10, 'duration_unit' => 'year', 'member_of_contact_id' => $orgContactID, 'relationship_type_id' => $relationshipTypeId, 'period_type' => 'fixed', 'duration_interval' => 1, 'financial_type_id' => 1, 'visibility' => 'Public', 'is_active' => 1);
     $membershipType = CRM_Member_BAO_MembershipType::add($params, $ids);
     $membership = $this->assertDBNotNull('CRM_Member_BAO_MembershipType', $orgContactID, 'name', 'member_of_contact_id', 'Database check on updated membership record.');
     $error = CRM_Financial_BAO_FinancialAccount::validateTogglingDeferredRevenue();
     $this->assertTrue(!empty($error), "Error message did not appear");
     $this->membershipTypeDelete(array('id' => $membershipType->id));
 }
开发者ID:nielosz,项目名称:civicrm-core,代码行数:17,代码来源:FinancialAccountTest.php

示例2: formRule

 /**
  * Global validation rules for the form.
  *
  * @param array $values
  *   posted values of the form
  * @param $files
  * @param $self
  *
  * @return array
  *   list of errors to be posted back to the form
  */
 public static function formRule($values, $files, $self)
 {
     $errors = array();
     if (CRM_Utils_Array::value('deferred_revenue_enabled', $values)) {
         $errorMessage = CRM_Financial_BAO_FinancialAccount::validateTogglingDeferredRevenue();
         if ($errorMessage) {
             // Since the error msg is too long and
             // takes the whole space to display inline
             // therefore setting blank text to highlight the field
             // setting actual error msg to _qf_default to show in pop-up screen
             $errors['deferred_revenue_enabled'] = ' ';
             $errors['_qf_default'] = $errorMessage;
         }
     }
     return $errors;
 }
开发者ID:nielosz,项目名称:civicrm-core,代码行数:27,代码来源:Contribute.php


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