+--------------------------------------------------------------------+
| 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$
*
*/
}
/**
- * 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() {
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;
return TRUE;
}
+
}