Add in Exception API to support the refactor of Dedupe Exception Page
authorAlok Patel <alok@agileware.com.au>
Sat, 16 Feb 2019 02:05:38 +0000 (13:05 +1100)
committerSeamus Lee <seamuslee001@gmail.com>
Sat, 16 Feb 2019 02:07:18 +0000 (13:07 +1100)
CRM/Dedupe/DAO/Exception.php
api/v3/Exception.php [new file with mode: 0644]
xml/schema/Dedupe/Exception.xml

index 03dac72f30819191f522bad166c3a2f1c498ce49..3e824fa3e6a914b536215275459fe12b1a385fa3 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Dedupe/Exception.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:8be54351020230bbff872ebf033c811b)
+ * (GenCodeChecksum:1f39e9ee1f80da1b62c054f6ca4119c5)
  */
 
 /**
@@ -97,6 +97,7 @@ class CRM_Dedupe_DAO_Exception extends CRM_Core_DAO {
           'type' => CRM_Utils_Type::T_INT,
           'title' => ts('First Dupe Contact ID'),
           'description' => ts('FK to Contact ID'),
+          'required' => TRUE,
           'table_name' => 'civicrm_dedupe_exception',
           'entity' => 'Exception',
           'bao' => 'CRM_Dedupe_DAO_Exception',
@@ -108,6 +109,7 @@ class CRM_Dedupe_DAO_Exception extends CRM_Core_DAO {
           'type' => CRM_Utils_Type::T_INT,
           'title' => ts('Second Dupe Contact ID'),
           'description' => ts('FK to Contact ID'),
+          'required' => TRUE,
           'table_name' => 'civicrm_dedupe_exception',
           'entity' => 'Exception',
           'bao' => 'CRM_Dedupe_DAO_Exception',
diff --git a/api/v3/Exception.php b/api/v3/Exception.php
new file mode 100644 (file)
index 0000000..9c50d4a
--- /dev/null
@@ -0,0 +1,62 @@
+<?php
+/*
+ +--------------------------------------------------------------------+
+ | CiviCRM version 5                                                  |
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC (c) 2004-2019                                |
+ +--------------------------------------------------------------------+
+ | This file is a part of CiviCRM.                                    |
+ |                                                                    |
+ | CiviCRM is free software; you can copy, modify, and distribute it  |
+ | under the terms of the GNU Affero General Public License           |
+ | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |
+ |                                                                    |
+ | CiviCRM is distributed in the hope that it will be useful, but     |
+ | WITHOUT ANY WARRANTY; without even the implied warranty of         |
+ | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |
+ | See the GNU Affero General Public License for more details.        |
+ |                                                                    |
+ | You should have received a copy of the GNU Affero General Public   |
+ | License and the CiviCRM Licensing Exception along                  |
+ | with this program; if not, contact CiviCRM LLC                     |
+ | at info[AT]civicrm[DOT]org. If you have questions about the        |
+ | GNU Affero General Public License or the licensing of CiviCRM,     |
+ | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
+ +--------------------------------------------------------------------+
+ */
+/**
+ * Get a Dedupe Exception.
+ *
+ * @param array $params
+ *   Array per getfields metadata.
+ *
+ * @return array
+ *   Array of all found dedupe exception object property values.
+ */
+function civicrm_api3_exception_get($params) {
+  return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
+}
+/**
+ * Create or update an dedupe exception.
+ *
+ * @param array $params
+ *          Array per getfields metadata.
+ *
+ * @return array api result array
+ */
+function civicrm_api3_exception_create($params) {
+  return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'Exception');
+}
+/**
+ * Delete an existing Exception.
+ *
+ * This method is used to delete any existing Exception given its id.
+ *
+ * @param array $params
+ *          [id]
+ *
+ * @return array api result array
+ */
+function civicrm_api3_exception_delete($params) {
+  return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
+}
index bf65f319de0faf57cd700bad57320f51b5c725b3..77afb22248115e9cfd10492dbad333738bfbbe8c 100644 (file)
@@ -23,6 +23,7 @@
     <type>int unsigned</type>
     <comment>FK to Contact ID</comment>
     <add>3.3</add>
+    <required>TRUE</required>
   </field>
   <foreignKey>
     <name>contact_id1</name>
@@ -37,6 +38,7 @@
     <type>int unsigned</type>
     <comment>FK to Contact ID</comment>
     <add>3.3</add>
+    <required>TRUE</required>
   </field>
   <foreignKey>
     <name>contact_id2</name>