<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
/**
* This is a contructor of the class.
*/
- function __construct() {}
+ public function __construct() {
+ }
/**
* Function is used to format the individual contact values
*
- * @param array $params (reference ) an assoc array of name/value pairs
- * @param array $contact contact object
+ * @param array $params
+ * (reference ) an assoc array of name/value pairs.
+ * @param array $contact
+ * Contact object.
*
- * @return object CRM_Contact_BAO_Contact object
- * @access public
+ * @return CRM_Contact_BAO_Contact object
* @static
*/
- static function format(&$params, &$contact) {
+ public static function format(&$params, &$contact) {
if (!self::dataExists($params)) {
return;
}
$params[$dbName] = $value;
$contact->$dbName = $value;
if ($value) {
- $$name = CRM_Core_PseudoConstant::getLabel('CRM_Contact_DAO_Contact', $name, $value);
+ $$name = CRM_Core_PseudoConstant::getLabel('CRM_Contact_DAO_Contact', $dbName, $value);
}
else {
$$name = NULL;
}
}
elseif ($value) {
- $$name = CRM_Core_PseudoConstant::getLabel('CRM_Contact_DAO_Contact', $name, $value);
+ $$name = CRM_Core_PseudoConstant::getLabel('CRM_Contact_DAO_Contact', $dbName, $value);
}
}
}
/**
- * regenerates display_name for contacts with given prefixes/suffixes
+ * Regenerates display_name for contacts with given prefixes/suffixes
*
- * @param array $ids the array with the prefix/suffix id governing which contacts to regenerate
- * @param int $action the action describing whether prefix/suffix was UPDATED or DELETED
+ * @param array $ids
+ * The array with the prefix/suffix id governing which contacts to regenerate.
+ * @param int $action
+ * The action describing whether prefix/suffix was UPDATED or DELETED.
*
* @return void
*/
- static function updateDisplayNames(&$ids, $action) {
+ public static function updateDisplayNames(&$ids, $action) {
// get the proper field name (prefix_id or suffix_id) and its value
$fieldName = '';
foreach ($ids as $key => $value) {
}
/**
- * creates display name
+ * Creates display name
*
- * @return string the constructed display name
+ * @return string
+ * the constructed display name
*/
- function displayName() {
+ public function displayName() {
$prefix = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'prefix_id');
$suffix = CRM_Core_PseudoConstant::get('CRM_Contact_DAO_Contact', 'suffix_id');
return str_replace(' ', ' ', trim($prefix[$this->prefix_id] . ' ' . $this->first_name . ' ' . $this->middle_name . ' ' . $this->last_name . ' ' . $suffix[$this->suffix_id]));
/**
* Check if there is data to create the object
*
- * @param array $params (reference ) an assoc array of name/value pairs
+ * @param array $params
+ * (reference ) an assoc array of name/value pairs.
*
* @return boolean
- * @access public
* @static
*/
- static function dataExists(&$params) {
+ public static function dataExists(&$params) {
if ($params['contact_type'] == 'Individual') {
return TRUE;
}
return FALSE;
}
}
-