CRM-14343 - Remove 250 limit for import errors
[civicrm-core.git] / CRM / Import / Parser.php
index 7791b129a9ad7cb5b97a0931355e2fe48d5eb2a8..738254e5c1898605fbecd18511c7b351e7923840 100644 (file)
@@ -34,7 +34,7 @@ abstract class CRM_Import_Parser {
   /**
    * Settings
    */
-  const MAX_ERRORS = 250, MAX_WARNINGS = 25, DEFAULT_TIMEOUT = 30;
+  const MAX_WARNINGS = 25, DEFAULT_TIMEOUT = 30;
 
   /**
    * Return codes
@@ -79,11 +79,6 @@ abstract class CRM_Import_Parser {
    */
   protected $_maxLinesToProcess;
 
-  /**
-   * Maximum number of invalid rows to store
-   */
-  protected $_maxErrorCount;
-
   /**
    * Array of error lines, bounded by MAX_ERROR
    */
@@ -192,7 +187,6 @@ abstract class CRM_Import_Parser {
    */
   public function __construct() {
     $this->_maxLinesToProcess = 0;
-    $this->_maxErrorCount = self::MAX_ERRORS;
   }
 
   /**
@@ -444,4 +438,20 @@ abstract class CRM_Import_Parser {
     return $fileName;
   }
 
+  /**
+   * Check if contact is a duplicate .
+   *
+   * @param array $formatValues
+   *
+   * @return array
+   */
+  protected function checkContactDuplicate(&$formatValues) {
+    //retrieve contact id using contact dedupe rule
+    $formatValues['contact_type'] = $this->_contactType;
+    $formatValues['version'] = 3;
+    require_once 'CRM/Utils/DeprecatedUtils.php';
+    $error = _civicrm_api3_deprecated_check_contact_dedupe($formatValues);
+    return $error;
+  }
+
 }