From b60efd6a4c9cd95e07fba0ec4f8f364dbcf0981a Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Mon, 18 May 2015 11:51:51 +1200 Subject: [PATCH] comment fixes --- CRM/Core/BAO/CustomField.php | 91 +++++++++++++++++------------------- 1 file changed, 43 insertions(+), 48 deletions(-) diff --git a/CRM/Core/BAO/CustomField.php b/CRM/Core/BAO/CustomField.php index c92a1f8407..a3b3e1bef9 100644 --- a/CRM/Core/BAO/CustomField.php +++ b/CRM/Core/BAO/CustomField.php @@ -29,25 +29,22 @@ * * @package CRM * @copyright CiviCRM LLC (c) 2004-2015 - * $Id$ - * */ /** * Business objects for managing custom data fields. - * */ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { /** - * Array for valid combinations of data_type & descriptions + * Array for valid combinations of data_type & descriptions. * * @var array */ public static $_dataType = NULL; /** - * Array for valid combinations of data_type & html_type + * Array for valid combinations of data_type & html_type. * * @var array */ @@ -87,6 +84,10 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { } /** + * Get data to html array. + * + * (Does this caching achieve anything?) + * * @return array */ public static function dataToHtml() { @@ -337,7 +338,6 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { * * @return Object * DAO object on success, null otherwise - * */ public static function setIsActive($id, $is_active) { @@ -356,7 +356,6 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { * * @return string * name - * */ public static function getTitle($id) { return CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomField', $id, 'label'); @@ -384,7 +383,6 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { * * @return array * an array of active custom fields. - * */ public static function &getFields( $customDataType = 'Individual', @@ -610,10 +608,8 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { * @param bool $withMultiple * * @return array - * - * */ - public static function &getFieldsForImport( + public static function getFieldsForImport( $contactType = 'Individual', $showAll = FALSE, $onlyParent = FALSE, @@ -677,6 +673,7 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { * The key to parse. * * @param bool $all + * * @return int|null * The id (if exists) */ @@ -746,7 +743,6 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { * True if used for search else false. * @param string $label * Label for custom field. - * */ public static function addQuickFormElement( &$qf, @@ -821,9 +817,7 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { $label = $field->label; } - /** - * at some point in time we might want to split the below into small functions - **/ + // at some point in time we might want to split the below into small functions switch ($widget) { case 'Text': @@ -1105,8 +1099,7 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { } /** - * Given a custom field value, its id and the set of options - * find the display value for this field + * Find the display value for this field. * * @param mixed $value * The custom field value. @@ -1367,7 +1360,6 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { * @param mixed $value * If passed - dont fetch value from db,. * just format the given value - * */ public static function setProfileDefaults( $customFieldId, @@ -1470,14 +1462,8 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { } /** - * @param int $contactID - * @param int $cfID - * @param int $fileID - * @param bool $absolute + * Get file url. * - * @return array - */ - /** * @param int $contactID * @param int $cfID * @param int $fileID @@ -1813,11 +1799,13 @@ SELECT $columnName } /** + * Get default custom table schema. + * * @param array $params * * @return array */ - public static function &defaultCustomTableSchema(&$params) { + public static function defaultCustomTableSchema($params) { // add the id and extends_id $table = array( 'name' => $params['name'], @@ -1856,8 +1844,10 @@ SELECT $columnName } /** - * @param $field - * @param $operation + * Create custom field. + * + * @param CRM_Core_DAO_CustomField $field + * @param string $operation * @param bool $indexExist * @param bool $triggerRebuild */ @@ -2008,14 +1998,12 @@ WHERE id IN ( %1, %2 ) } /** - * Move a custom data field from one group (table) to another + * Move a custom data field from one group (table) to another. * * @param int $fieldID * FK to civicrm_custom_field. * @param int $newGroupID * FK to civicrm_custom_group. - * - * @return void */ public static function moveField($fieldID, $newGroupID) { $validation = self::_moveFieldValidate($fieldID, $newGroupID); @@ -2092,16 +2080,14 @@ AND cf.id = %1"; * Get custom option groups. * * @param array $includeFieldIds - * Ids of custom fields for which. - * option groups must be included. + * Ids of custom fields for which option groups must be included. * * Currently this is required in the cases where option groups are to be included * for inactive fields : CRM-5369 * - * * @return mixed */ - public static function &customOptionGroup($includeFieldIds = NULL) { + public static function customOptionGroup($includeFieldIds = NULL) { static $customOptionGroup = NULL; $cacheKey = (empty($includeFieldIds)) ? 'onlyActive' : 'force'; @@ -2142,8 +2128,6 @@ INNER JOIN civicrm_custom_field f ON ( g.id = f.option_group_id ) * Custom field id. * @param int $optionGroupId * Option group id. - * - * @return void */ public static function fixOptionGroups($customFieldId, $optionGroupId) { // check if option group belongs to any custom Field else delete @@ -2163,13 +2147,10 @@ INNER JOIN civicrm_custom_field f ON ( g.id = f.option_group_id ) } /** - * Check if option group is related to more than one - * custom field + * Check if option group is related to more than one custom field. * * @param int $optionGroupId * Option group id. - * - * @return void */ public static function checkOptionGroup($optionGroupId) { $query = " @@ -2186,8 +2167,10 @@ WHERE option_group_id = {$optionGroupId}"; } /** + * Get option group default. + * * @param int $optionGroupId - * @param $htmlType + * @param string $htmlType * * @return null|string */ @@ -2233,9 +2216,11 @@ ORDER BY html_type"; } /** + * Post process function. + * * @param array $params * @param int $entityID - * @param $customFieldExtends + * @param string $customFieldExtends * @param bool $inline * * @return array @@ -2275,8 +2260,10 @@ ORDER BY html_type"; } /** - * @param $field - * @param $options + * Build option. + * + * @param array $field + * @param array $options * * @throws Exception */ @@ -2330,10 +2317,12 @@ SELECT label, value } /** - * @param $fieldLabel + * Get custom field ID. + * + * @param string $fieldLabel * @param null $groupTitle * - * @return null + * @return int|null */ public static function getCustomFieldID($fieldLabel, $groupTitle = NULL) { $params = array(1 => array($fieldLabel, 'String')); @@ -2503,6 +2492,8 @@ WHERE f.id IN ($ids)"; } /** + * Is this field a multi record field. + * * @param int $customId * * @return bool @@ -2532,7 +2523,9 @@ WHERE cf.id = %1 AND cg.is_multiple = 1"; /** * Does this field store a serialized string? - * @param CRM_Core_DAO_CustomField|array $field + * + * @param array $field + * * @return bool */ public static function isSerialized($field) { @@ -2543,6 +2536,8 @@ WHERE cf.id = %1 AND cg.is_multiple = 1"; } /** + * Get options for field. + * * @param array $field * @param string|null $optionGroupName */ -- 2.25.1