_name = $name; $this->_title = $title; $this->_type = $type; $this->_columnPattern = $columnPattern; $this->_dataPattern = $dataPattern; $this->_hasLocationType = $hasLocationType; $this->_phoneType = $phoneType; $this->_related = $related; $this->_relatedContactType = $relatedContactType; $this->_relatedContactDetails = $relatedContactDetails; $this->_relatedContactLocType = $relatedContactLocType; $this->_relatedContactPhoneType = $relatedContactPhoneType; $this->_value = NULL; } public function resetValue() { $this->_value = NULL; } /** * The value is in string format. convert the value to the type of this field * and set the field value with the appropriate type */ public function setValue($value) { $this->_value = $value; } /** * @return bool */ public function validate() { // echo $this->_value."===========
"; $message = ''; if ($this->_value === NULL) { return TRUE; } // Commented due to bug CRM-150, internationalization/wew. // if ( $this->_name == 'phone' ) { // return CRM_Utils_Rule::phone( $this->_value ); // } if ($this->_name == 'email') { return CRM_Utils_Rule::email($this->_value); } } }