Add in Wrapper template around DatePickerRange template to have better layout of...
[civicrm-core.git] / api / v3 / MembershipType.php
index 5011383c689781edb7e60be0b059198d37af4732..386626c548f784ef2c3749b94d699e54236cf765 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 5                                                  |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2017                                |
+ | Copyright CiviCRM LLC (c) 2004-2019                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -42,7 +42,7 @@
  */
 function civicrm_api3_membership_type_create($params) {
   // Workaround for fields using nonstandard serialization
-  foreach (array('relationship_type_id', 'relationship_direction') as $field) {
+  foreach (['relationship_type_id', 'relationship_direction'] as $field) {
     if (isset($params[$field]) && is_array($params[$field])) {
       $params[$field] = implode(CRM_Core_DAO::VALUE_SEPARATOR, $params[$field]);
     }
@@ -59,8 +59,7 @@ function civicrm_api3_membership_type_create($params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_membership_type_create_spec(&$params) {
-  // todo could set default here probably
-  $params['domain_id']['api.required'] = 1;
+  $params['domain_id']['api.default'] = CRM_Core_Config::domainID();
   $params['member_of_contact_id']['api.required'] = 1;
   $params['financial_type_id']['api.required'] = 1;
   $params['name']['api.required'] = 1;
@@ -86,7 +85,7 @@ function civicrm_api3_membership_type_get($params) {
   if (!empty($results['values']) && is_array($results['values'])) {
     foreach ($results['values'] as &$item) {
       // Workaround for fields using nonstandard serialization
-      foreach (array('relationship_type_id', 'relationship_direction') as $field) {
+      foreach (['relationship_type_id', 'relationship_direction'] as $field) {
         if (isset($item[$field]) && !is_array($item[$field])) {
           $item[$field] = (array) $item[$field];
         }