Merge pull request #5473 from aydun/CRM-16160
[civicrm-core.git] / CRM / Contribute / Import / Field.php
index d256d59827a10cbe037c8d8c5fb06e6e47b036d4..bce94036858117becab9f00c354dce5e890f5ba8 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
  * $Id$
  *
  */
@@ -113,14 +113,20 @@ class CRM_Contribute_Import_Field {
   }
 
   /**
-   * The value is in string format. convert the value to the type of this field
+   * Set a value.
+   *
+   * The value is in string format. Convert the value to the type of this field
    * and set the field value with the appropriate type
+   *
+   * @param $value
    */
   public function setValue($value) {
     $this->_value = $value;
   }
 
   /**
+   * Validate a field.
+   *
    * @return bool
    */
   public function validate() {
@@ -165,10 +171,10 @@ class CRM_Contribute_Import_Field {
       case 'currency':
         return CRM_Utils_Rule::currencyCode($this->_value);
 
-        case 'financial_type':
+      case 'financial_type':
         static $contributionTypes = NULL;
         if (!$contributionTypes) {
-                $contributionTypes = CRM_Contribute_PseudoConstant::financialType();
+          $contributionTypes = CRM_Contribute_PseudoConstant::financialType();
         }
         if (in_array($this->_value, $contributionTypes)) {
           return TRUE;
@@ -210,4 +216,5 @@ class CRM_Contribute_Import_Field {
 
     return TRUE;
   }
+
 }