From b5c2afd0774992248f42a13f242e1592e49cdfbc Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sat, 24 May 2014 13:50:48 +1200 Subject: [PATCH] Add missing comments in CRM/Core --- CRM/Core/BAO/ActionSchedule.php | 50 ++++++++++++++ CRM/Core/BAO/Address.php | 9 +++ CRM/Core/BAO/CMSUser.php | 16 +++++ CRM/Core/BAO/Cache.php | 3 + CRM/Core/BAO/ConfigSetting.php | 12 ++++ CRM/Core/BAO/CustomField.php | 68 ++++++++++++++++++ CRM/Core/BAO/CustomGroup.php | 37 ++++++++++ CRM/Core/BAO/CustomOption.php | 11 +++ CRM/Core/BAO/CustomQuery.php | 8 +++ CRM/Core/BAO/CustomValue.php | 3 + CRM/Core/BAO/CustomValueTable.php | 17 +++++ CRM/Core/BAO/Dashboard.php | 11 +++ CRM/Core/BAO/Domain.php | 32 +++++++++ CRM/Core/BAO/Email.php | 3 + CRM/Core/BAO/File.php | 55 +++++++++++++++ CRM/Core/BAO/FinancialTrxn.php | 23 +++++++ CRM/Core/BAO/Location.php | 6 ++ CRM/Core/BAO/LocationType.php | 3 + CRM/Core/BAO/Log.php | 12 ++++ CRM/Core/BAO/Mapping.php | 10 +++ CRM/Core/BAO/MessageTemplate.php | 12 ++++ CRM/Core/BAO/Navigation.php | 5 ++ CRM/Core/BAO/Persistent.php | 6 ++ CRM/Core/BAO/Phone.php | 6 ++ CRM/Core/BAO/Preferences.php | 11 +++ CRM/Core/BAO/PrevNextCache.php | 68 ++++++++++++++++++ CRM/Core/BAO/SchemaHandler.php | 76 +++++++++++++++++++++ CRM/Core/BAO/Setting.php | 50 ++++++++++++++ CRM/Core/BAO/Tag.php | 26 +++++++ CRM/Core/BAO/UFField.php | 6 ++ CRM/Core/BAO/UFGroup.php | 18 +++++ CRM/Core/BAO/UFJoin.php | 8 +++ CRM/Core/BAO/UFMatch.php | 13 ++++ CRM/Core/BAO/WordReplacement.php | 9 +++ CRM/Core/CodeGen/BaseTask.php | 3 + CRM/Core/CodeGen/Main.php | 3 + CRM/Core/CodeGen/Util/File.php | 3 + CRM/Core/CodeGen/Util/Template.php | 3 + CRM/Core/CodeGen/Util/Xml.php | 3 + CRM/Core/DAO.php | 7 ++ CRM/Core/DAO/Factory.php | 4 ++ CRM/Core/Error.php | 14 ++++ CRM/Core/Exception.php | 15 ++++ CRM/Core/Form.php | 7 ++ CRM/Core/I18n/Form.php | 9 +++ CRM/Core/Page/Angular.php | 9 ++- CRM/Core/Payment/AuthorizeNetIPN.php | 3 + CRM/Core/Payment/Google.php | 9 +++ CRM/Core/Payment/IATS.php | 9 +++ CRM/Core/Payment/Moneris.php | 9 +++ CRM/Core/Payment/PayJunction.php | 9 +++ CRM/Core/Payment/PayPalIPN.php | 4 ++ CRM/Core/Payment/PayPalImpl.php | 8 +++ CRM/Core/Payment/PayflowPro.php | 19 +++++- CRM/Core/Payment/PaymentExpress.php | 17 +++++ CRM/Core/Permission/UnitTests.php | 8 +++ CRM/Core/QuickForm/GroupMultiSelect.php | 7 ++ CRM/Core/QuickForm/NestedAdvMultiSelect.php | 18 +++++ CRM/Core/Reference/Interface.php | 4 ++ CRM/Core/Smarty/Permissions.php | 5 +- 60 files changed, 909 insertions(+), 3 deletions(-) diff --git a/CRM/Core/BAO/ActionSchedule.php b/CRM/Core/BAO/ActionSchedule.php index a782e61719..7102700a25 100755 --- a/CRM/Core/BAO/ActionSchedule.php +++ b/CRM/Core/BAO/ActionSchedule.php @@ -39,6 +39,11 @@ */ class CRM_Core_BAO_ActionSchedule extends CRM_Core_DAO_ActionSchedule { + /** + * @param null $id + * + * @return array + */ static function getMapping($id = NULL) { static $_action_mapping; @@ -225,6 +230,11 @@ class CRM_Core_BAO_ActionSchedule extends CRM_Core_DAO_ActionSchedule { ); } + /** + * @param null $id + * + * @return array + */ static function getSelection1($id = NULL) { $mapping = self::getMapping($id); $sel4 = $sel5 = array(); @@ -370,6 +380,16 @@ WHERE cas.entity_value = $id AND return $list; } + /** + * @param $contactId + * @param $to + * @param $scheduleID + * @param $from + * @param $tokenParams + * + * @return bool|null + * @throws CRM_Core_Exception + */ static function sendReminder($contactId, $to, $scheduleID, $from, $tokenParams) { $email = $to['email']; $phoneNumber = $to['phone']; @@ -601,6 +621,12 @@ WHERE cas.entity_value = $id AND return CRM_Core_DAO::setFieldValue('CRM_Core_DAO_ActionSchedule', $id, 'is_active', $is_active); } + /** + * @param $mappingID + * @param $now + * + * @throws CRM_Core_Exception + */ static function sendMailings($mappingID, $now) { $domainValues = CRM_Core_BAO_Domain::getNameAndEmail(); $fromEmailAddress = "$domainValues[0] <$domainValues[1]>"; @@ -814,6 +840,13 @@ WHERE reminder.action_schedule_id = %1 AND reminder.action_date_time IS NULL } } + /** + * @param $mappingID + * @param $now + * @param array $params + * + * @throws API_Exception + */ static function buildRecipientContacts($mappingID, $now, $params = array()) { $actionSchedule = new CRM_Core_DAO_ActionSchedule(); $actionSchedule->mapping_id = $mappingID; @@ -1195,6 +1228,11 @@ GROUP BY reminder.contact_id } } + /** + * @param $field + * + * @return null|string + */ static function permissionedRelationships($field) { $query = ' SELECT cm.id AS owner_id, cm.contact_id AS owner_contact, m.id AS slave_id, m.contact_id AS slave_contact, cmt.relationship_type_id AS relation_type, rel.contact_id_a, rel.contact_id_b, rel.is_permission_a_b, rel.is_permission_b_a @@ -1225,6 +1263,12 @@ WHERE m.owner_membership_id IS NOT NULL AND return NULL; } + /** + * @param null $now + * @param array $params + * + * @return array + */ static function processQueue($now = NULL, $params = array()) { $now = $now ? CRM_Utils_Time::setTime($now) : CRM_Utils_Time::getTime(); @@ -1259,6 +1303,12 @@ WHERE m.owner_membership_id IS NOT NULL AND return CRM_Core_DAO::singleValueQuery($queryString, $params); } + /** + * @param $mappingID + * @param $recipientType + * + * @return array + */ static function getRecipientListing($mappingID, $recipientType) { $options = array(); if (!$mappingID || !$recipientType) { diff --git a/CRM/Core/BAO/Address.php b/CRM/Core/BAO/Address.php index 3b5e46e506..e842940920 100644 --- a/CRM/Core/BAO/Address.php +++ b/CRM/Core/BAO/Address.php @@ -655,6 +655,10 @@ ORDER BY civicrm_address.is_primary DESC, civicrm_address.location_type_id DESC, return $addresses; } + /** + * @param $stateCountryMap + * @param null $defaults + */ static function addStateCountryMap(&$stateCountryMap, $defaults = NULL) { // first fix the statecountry map if needed if (empty($stateCountryMap)) { @@ -669,6 +673,11 @@ ORDER BY civicrm_address.is_primary DESC, civicrm_address.location_type_id DESC, $config->stateCountryMap = array_merge($config->stateCountryMap, $stateCountryMap); } + /** + * @param $form + * @param $defaults + * @param bool $batchFieldNames + */ static function fixAllStateSelects(&$form, $defaults, $batchFieldNames = false) { $config = CRM_Core_Config::singleton(); $map = null; diff --git a/CRM/Core/BAO/CMSUser.php b/CRM/Core/BAO/CMSUser.php index 2c7c219e91..ee2df90552 100644 --- a/CRM/Core/BAO/CMSUser.php +++ b/CRM/Core/BAO/CMSUser.php @@ -38,6 +38,10 @@ */ require_once 'DB.php'; + +/** + * Class CRM_Core_BAO_CMSUser + */ class CRM_Core_BAO_CMSUser { /** @@ -344,6 +348,13 @@ class CRM_Core_BAO_CMSUser { * @param array $self reference to form object * */ + /** + * @param $fields + * @param $files + * @param $self + * + * @return array|bool + */ static function formRule($fields, $files, $self) { if (empty($fields['cms_create_account'])) { return TRUE; @@ -480,6 +491,11 @@ class CRM_Core_BAO_CMSUser { return $result; } + /** + * @param $config + * + * @return object + */ static function &dbHandle(&$config) { $errorScope = CRM_Core_TemporaryErrorScope::ignoreException(); $db_uf = DB::connect($config->userFrameworkDSN); diff --git a/CRM/Core/BAO/Cache.php b/CRM/Core/BAO/Cache.php index e4c986ac2c..7b13b49d37 100644 --- a/CRM/Core/BAO/Cache.php +++ b/CRM/Core/BAO/Cache.php @@ -278,6 +278,9 @@ class CRM_Core_BAO_Cache extends CRM_Core_DAO_Cache { * @access private */ + /** + * @param $names + */ static function restoreSessionFromCache($names) { foreach ($names as $key => $sessionName) { if (is_array($sessionName)) { diff --git a/CRM/Core/BAO/ConfigSetting.php b/CRM/Core/BAO/ConfigSetting.php index 15ef3bd615..d86a57a74f 100644 --- a/CRM/Core/BAO/ConfigSetting.php +++ b/CRM/Core/BAO/ConfigSetting.php @@ -366,6 +366,9 @@ class CRM_Core_BAO_ConfigSetting { } } + /** + * @return array + */ static function getConfigSettings() { $config = CRM_Core_Config::singleton(); @@ -469,6 +472,12 @@ class CRM_Core_BAO_ConfigSetting { return array($url, $dir, $siteName, $siteRoot); } + /** + * @param array $defaultValues + * + * @return string + * @throws Exception + */ static function doSiteMove($defaultValues = array() ) { $moveStatus = ts('Beginning site move process...') . '
'; // get the current and guessed values @@ -648,6 +657,9 @@ WHERE option_group_id = ( return TRUE; } + /** + * @return array + */ static function skipVars() { return array( 'dsn', 'templateCompileDir', diff --git a/CRM/Core/BAO/CustomField.php b/CRM/Core/BAO/CustomField.php index 8911e952a0..5411668fb7 100644 --- a/CRM/Core/BAO/CustomField.php +++ b/CRM/Core/BAO/CustomField.php @@ -92,6 +92,9 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { return self::$_dataType; } + /** + * @return array + */ static function dataToHtml() { if (!self::$_dataToHtml) { self::$_dataToHtml = array( @@ -1177,6 +1180,17 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { ); } + /** + * @param $value + * @param $option + * @param $html_type + * @param $data_type + * @param null $format + * @param null $contactID + * @param null $fieldID + * + * @return array|mixed|null|string + */ static function getDisplayValueCommon($value, &$option, $html_type, @@ -1492,6 +1506,22 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { } } + /** + * @param $contactID + * @param $cfID + * @param null $fileID + * @param bool $absolute + * + * @return array + */ + /** + * @param $contactID + * @param $cfID + * @param null $fileID + * @param bool $absolute + * + * @return array + */ static function getFileURL($contactID, $cfID, $fileID = NULL, $absolute = FALSE) { if ($contactID) { if (!$fileID) { @@ -1802,6 +1832,11 @@ SELECT $columnName return $customFormatted; } + /** + * @param $params + * + * @return array + */ static function &defaultCustomTableSchema(&$params) { // add the id and extends_id $table = array( @@ -1840,6 +1875,12 @@ SELECT $columnName return $table; } + /** + * @param $field + * @param $operation + * @param bool $indexExist + * @param bool $triggerRebuild + */ static function createField($field, $operation, $indexExist = FALSE, $triggerRebuild = TRUE) { $tableName = CRM_Core_DAO::getFieldValue( 'CRM_Core_DAO_CustomGroup', @@ -2166,6 +2207,12 @@ WHERE option_group_id = {$optionGroupId}"; } } + /** + * @param $optionGroupId + * @param $htmlType + * + * @return null|string + */ static function getOptionGroupDefault($optionGroupId, $htmlType) { $query = " SELECT default_value, html_type @@ -2207,6 +2254,15 @@ ORDER BY html_type"; return $defaultValue; } + /** + * @param $params + * @param $customFields + * @param $entityID + * @param $customFieldExtends + * @param bool $inline + * + * @return array + */ static function postProcess(&$params, &$customFields, $entityID, @@ -2241,6 +2297,12 @@ ORDER BY html_type"; return $customData; } + /** + * @param $field + * @param $options + * + * @throws Exception + */ static function buildOption($field, &$options) { // Fixme - adding anything but options to the $options array is a bad idea // What if an option had the key 'attributes'? @@ -2289,6 +2351,12 @@ SELECT label, value } } + /** + * @param $fieldLabel + * @param null $groupTitle + * + * @return null + */ static function getCustomFieldID($fieldLabel, $groupTitle = NULL) { $params = array(1 => array($fieldLabel, 'String')); if ($groupTitle) { diff --git a/CRM/Core/BAO/CustomGroup.php b/CRM/Core/BAO/CustomGroup.php index 2819836210..abe4be26be 100644 --- a/CRM/Core/BAO/CustomGroup.php +++ b/CRM/Core/BAO/CustomGroup.php @@ -995,6 +995,13 @@ ORDER BY civicrm_custom_group.weight, return $groupTree; } + /** + * @param $entityType + * @param $path + * @param string $cidToken + * + * @return array + */ public static function &getActiveGroups($entityType, $path, $cidToken = '%%cid%%') { // for Group's $customGroupDAO = new CRM_Core_DAO_CustomGroup(); @@ -1212,6 +1219,13 @@ ORDER BY civicrm_custom_group.weight, return TRUE; } + /** + * @param $groupTree + * @param $defaults + * @param bool $viewMode + * @param bool $inactiveNeeded + * @param int $action + */ static function setDefaults(&$groupTree, &$defaults, $viewMode = FALSE, $inactiveNeeded = FALSE, $action = CRM_Core_Action::NONE) { foreach ($groupTree as $id => $group) { if (!isset($group['fields'])) { @@ -1349,6 +1363,11 @@ ORDER BY civicrm_custom_group.weight, } } + /** + * @param $groupTree + * @param $params + * @param bool $skipFile + */ static function postProcess(&$groupTree, &$params, $skipFile = FALSE) { // Get the Custom form values and groupTree // first reset all checkbox and radio data @@ -1626,6 +1645,12 @@ ORDER BY civicrm_custom_group.weight, return TRUE; } + /** + * @param $table + * + * @return string + * @throws Exception + */ static function mapTableName($table) { switch ($table) { case 'Contact': @@ -1689,6 +1714,9 @@ SELECT IF( EXISTS(SELECT name FROM civicrm_contact_type WHERE name like %1), 1, } } + /** + * @param $group + */ static function createTable($group) { $params = array( 'name' => $group->table_name, @@ -2202,6 +2230,12 @@ SELECT civicrm_custom_group.id as groupID, civicrm_custom_group.title as groupT return $objTypes; } + /** + * @param $customGroupId + * @param $entityId + * + * @return bool + */ static function hasReachedMaxLimit($customGroupId, $entityId) { //check whether the group is multiple $isMultiple = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $customGroupId, 'is_multiple'); @@ -2226,6 +2260,9 @@ SELECT civicrm_custom_group.id as groupID, civicrm_custom_group.title as groupT return $hasReachedMax; } + /** + * @return array + */ static function getMultipleFieldGroup() { $multipleGroup = array(); $dao = new CRM_Core_DAO_CustomGroup(); diff --git a/CRM/Core/BAO/CustomOption.php b/CRM/Core/BAO/CustomOption.php index 0317c867d7..bf2cb527d9 100644 --- a/CRM/Core/BAO/CustomOption.php +++ b/CRM/Core/BAO/CustomOption.php @@ -212,6 +212,11 @@ WHERE id = %1"; } } + /** + * @param $params + * + * @throws Exception + */ static function updateCustomValues($params) { $optionDAO = new CRM_Core_DAO_OptionValue(); $optionDAO->id = $params['optionId']; @@ -279,6 +284,12 @@ SET {$dao->columnName} = REPLACE( {$dao->columnName}, %1, %2 )"; } } + /** + * @param $customFieldID + * @param null $optionGroupID + * + * @return array + */ static function valuesByID($customFieldID, $optionGroupID = NULL) { if (!$optionGroupID) { $optionGroupID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomField', diff --git a/CRM/Core/BAO/CustomQuery.php b/CRM/Core/BAO/CustomQuery.php index 7306002162..6a36b4468d 100644 --- a/CRM/Core/BAO/CustomQuery.php +++ b/CRM/Core/BAO/CustomQuery.php @@ -625,6 +625,14 @@ SELECT label, value ); } + /** + * @param $id + * @param $label + * @param $type + * @param $fieldName + * @param $value + * @param $grouping + */ function searchRange(&$id, &$label, $type, $fieldName, &$value, &$grouping) { $qill = array(); diff --git a/CRM/Core/BAO/CustomValue.php b/CRM/Core/BAO/CustomValue.php index d0af961c21..bc4e0ccc47 100644 --- a/CRM/Core/BAO/CustomValue.php +++ b/CRM/Core/BAO/CustomValue.php @@ -160,6 +160,9 @@ class CRM_Core_BAO_CustomValue extends CRM_Core_DAO { } + /** + * @param $formValues + */ public static function fixFieldValueOfTypeMemo(&$formValues) { if (empty($formValues)) { return NULL; diff --git a/CRM/Core/BAO/CustomValueTable.php b/CRM/Core/BAO/CustomValueTable.php index 765cc3dd5c..ada4ee3fe9 100644 --- a/CRM/Core/BAO/CustomValueTable.php +++ b/CRM/Core/BAO/CustomValueTable.php @@ -34,6 +34,11 @@ */ class CRM_Core_BAO_CustomValueTable { + /** + * @param $customParams + * + * @throws Exception + */ static function create(&$customParams) { if (empty($customParams) || !is_array($customParams) @@ -300,6 +305,11 @@ class CRM_Core_BAO_CustomValueTable { } } + /** + * @param $params + * @param $entityTable + * @param $entityID + */ static function store(&$params, $entityTable, $entityID) { $cvParams = array(); foreach ($params as $fieldID => $param) { @@ -341,6 +351,13 @@ class CRM_Core_BAO_CustomValueTable { } } + /** + * @param $params + * @param $customFields + * @param $entityTable + * @param $entityID + * @param $customFieldExtends + */ static function postProcess(&$params, &$customFields, $entityTable, $entityID, $customFieldExtends) { $customData = CRM_Core_BAO_CustomField::postProcess($params, $customFields, diff --git a/CRM/Core/BAO/Dashboard.php b/CRM/Core/BAO/Dashboard.php index 82f5794fb5..04be3b2251 100644 --- a/CRM/Core/BAO/Dashboard.php +++ b/CRM/Core/BAO/Dashboard.php @@ -120,6 +120,12 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard { return $defaultDashlet ? $defaultDashlet : $dashlets; } + /** + * @param $hasDashlets + * + * @return bool + * @throws CiviCRM_API3_Exception + */ static function initializeDashlets($hasDashlets) { $getDashlets = civicrm_api3("Dashboard", "get", array('domain_id' => CRM_Core_Config::domainID())); $contactID = CRM_Core_Session::singleton()->get('userID'); @@ -421,6 +427,11 @@ class CRM_Core_BAO_Dashboard extends CRM_Core_DAO_Dashboard { return $dashlet; } + /** + * @param $url + * + * @return string + */ static function getDashletName($url) { $urlElements = explode('/', $url); if ($urlElements[1] == 'dashlet') { diff --git a/CRM/Core/BAO/Domain.php b/CRM/Core/BAO/Domain.php index a3236dd33f..8a4a9de271 100644 --- a/CRM/Core/BAO/Domain.php +++ b/CRM/Core/BAO/Domain.php @@ -120,6 +120,11 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain { CRM_Core_Config::singleton(TRUE, TRUE); } + /** + * @param bool $skipUsingCache + * + * @return null|string + */ static function version( $skipUsingCache = false ) { return CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Domain', CRM_Core_Config::domainID(), @@ -184,6 +189,9 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain { return $domain; } + /** + * @return bool + */ static function multipleDomains() { $session = CRM_Core_Session::singleton(); @@ -196,6 +204,11 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain { return $numberDomains > 1 ? TRUE : FALSE; } + /** + * @param bool $skipFatal + * + * @throws Exception + */ static function getNameAndEmail($skipFatal = FALSE) { $fromEmailAddress = CRM_Core_OptionGroup::values('from_email_address', NULL, NULL, NULL, ' AND is_default = 1'); if (!empty($fromEmailAddress)) { @@ -219,6 +232,11 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain { CRM_Core_Error::fatal($status); } + /** + * @param $contactID + * + * @return bool|null|object|string + */ static function addContactToDomainGroup($contactID) { $groupID = self::getGroupId(); @@ -231,6 +249,9 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain { return FALSE; } + /** + * @return bool|null|object|string + */ static function getGroupId() { static $groupID = NULL; @@ -269,11 +290,19 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain { return $groupID ? $groupID : FALSE; } + /** + * @param $groupId + * + * @return bool + */ static function isDomainGroup($groupId) { $domainGroupID = self::getGroupId(); return $domainGroupID == $groupId ? TRUE : FALSE; } + /** + * @return array + */ static function getChildGroupIds() { $domainGroupID = self::getGroupId(); $childGrps = array(); @@ -286,6 +315,9 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain { } // function to retrieve a list of contact-ids that belongs to current domain/site. + /** + * @return array + */ static function getContactList() { $siteGroups = CRM_Core_BAO_Domain::getChildGroupIds(); $siteContacts = array(); diff --git a/CRM/Core/BAO/Email.php b/CRM/Core/BAO/Email.php index 258cb4de4e..61a9370068 100644 --- a/CRM/Core/BAO/Email.php +++ b/CRM/Core/BAO/Email.php @@ -320,6 +320,9 @@ AND reset_date IS NULL return $fromEmailValues; } + /** + * @return object + */ static function isMultipleBulkMail() { return CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME, 'civimail_multiple_bulk_emails', NULL, FALSE); } diff --git a/CRM/Core/BAO/File.php b/CRM/Core/BAO/File.php index 1a66be5954..c1bd7a08f7 100644 --- a/CRM/Core/BAO/File.php +++ b/CRM/Core/BAO/File.php @@ -40,6 +40,13 @@ static $_signableFields = array('entityTable', 'entityID', 'fileID'); + /** + * @param $fileID + * @param $entityID + * @param null $entityTable + * + * @return array + */ static function path($fileID, $entityID, $entityTable = NULL) { $entityFileDAO = new CRM_Core_DAO_EntityFile(); if ($entityTable) { @@ -65,6 +72,19 @@ } + /** + * @param $data + * @param $fileTypeID + * @param $entityTable + * @param $entityID + * @param $entitySubtype + * @param bool $overwrite + * @param null $fileParams + * @param string $uploadName + * @param null $mimeType + * + * @throws Exception + */ static function filePostProcess( $data, $fileTypeID, @@ -302,6 +322,14 @@ return $results; } + /** + * @param $entityTable + * @param $entityID + * @param null $fileTypeID + * @param null $fileID + * + * @return array + */ static function sql($entityTable, $entityID, $fileTypeID = NULL, $fileID = NULL) { $sql = " SELECT CF.id as cfID, @@ -332,6 +360,13 @@ return array($sql, $params); } + /** + * @param $form + * @param $entityTable + * @param null $entityID + * @param null $numAttachments + * @param bool $ajaxDelete + */ static function buildAttachment(&$form, $entityTable, $entityID = NULL, $numAttachments = NULL, $ajaxDelete = FALSE) { if (!$numAttachments) { @@ -421,6 +456,12 @@ return NULL; } + /** + * @param $formValues + * @param $params + * @param $entityTable + * @param null $entityID + */ static function formatAttachment( &$formValues, &$params, @@ -469,6 +510,11 @@ } } + /** + * @param $params + * @param $entityTable + * @param $entityID + */ static function processAttachment(&$params, $entityTable, $entityID) { $numAttachments = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'max_attachments'); @@ -492,6 +538,9 @@ } } + /** + * @return array + */ static function uploadNames() { $numAttachments = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'max_attachments'); @@ -507,6 +556,12 @@ * Function to copy/attach an existing file to a different entity * table and id. */ + /** + * @param $oldEntityTable + * @param $oldEntityId + * @param $newEntityTable + * @param $newEntityId + */ static function copyEntityFile($oldEntityTable, $oldEntityId, $newEntityTable, $newEntityId) { $oldEntityFile = new CRM_Core_DAO_EntityFile(); $oldEntityFile->entity_id = $oldEntityId; diff --git a/CRM/Core/BAO/FinancialTrxn.php b/CRM/Core/BAO/FinancialTrxn.php index f36769d949..f7f2e077cb 100644 --- a/CRM/Core/BAO/FinancialTrxn.php +++ b/CRM/Core/BAO/FinancialTrxn.php @@ -34,6 +34,15 @@ */ class CRM_Core_BAO_FinancialTrxn extends CRM_Financial_DAO_FinancialTrxn { + /** + * class constructor + * + * @access public + * @return \CRM_Financial_DAO_FinancialTrxn + */ + /** + * + */ function __construct() { parent::__construct(); } @@ -83,6 +92,12 @@ class CRM_Core_BAO_FinancialTrxn extends CRM_Financial_DAO_FinancialTrxn { return $trxn; } + /** + * @param $contributionId + * @param null $contributionFinancialTypeId + * + * @return array + */ static function getBalanceTrxnAmt($contributionId, $contributionFinancialTypeId = NULL) { if (!$contributionFinancialTypeId) { $contributionFinancialTypeId = CRM_Core_DAO::getFieldValue('CRM_Contribute_BAO_Contribution', $contributionId, 'financial_type_id'); @@ -420,6 +435,14 @@ WHERE ceft.entity_id = %1"; * return @array : payment type => amount * payment type : 'amount_owed' or 'refund_due' */ + /** + * @param $entityId + * @param string $entityName + * @param bool $returnType + * @param null $lineItemTotal + * + * @return array|int|null|string + */ static function getPartialPaymentWithType($entityId, $entityName = 'participant', $returnType = TRUE, $lineItemTotal = NULL) { $value = NULL; if (empty($entityName)) { diff --git a/CRM/Core/BAO/Location.php b/CRM/Core/BAO/Location.php index 0c2b899a0b..092e86e089 100644 --- a/CRM/Core/BAO/Location.php +++ b/CRM/Core/BAO/Location.php @@ -310,6 +310,12 @@ WHERE e.id = %1"; * @param int $updateLocBlockId update location block id * @return int newly created/updated location block id. */ + /** + * @param $locBlockId + * @param null $updateLocBlockId + * + * @return mixed + */ static function copyLocBlock($locBlockId, $updateLocBlockId = NULL) { //get the location info. $defaults = $updateValues = array(); diff --git a/CRM/Core/BAO/LocationType.php b/CRM/Core/BAO/LocationType.php index de2f9384cc..de7d95ad1e 100644 --- a/CRM/Core/BAO/LocationType.php +++ b/CRM/Core/BAO/LocationType.php @@ -109,6 +109,9 @@ class CRM_Core_BAO_LocationType extends CRM_Core_DAO_LocationType { * Get ID of billing location type * @return integer */ + /** + * @return mixed|null + */ static function getBilling() { if (self::$_billingLocationType == NULL) { $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', array(), 'validate'); diff --git a/CRM/Core/BAO/Log.php b/CRM/Core/BAO/Log.php index dac5f77e9d..c11f565fe0 100644 --- a/CRM/Core/BAO/Log.php +++ b/CRM/Core/BAO/Log.php @@ -39,6 +39,12 @@ class CRM_Core_BAO_Log extends CRM_Core_DAO_Log { static $_processed = NULL; + /** + * @param $id + * @param string $table + * + * @return array|null + */ static function &lastModified($id, $table = 'civicrm_contact') { $log = new CRM_Core_DAO_Log(); @@ -74,6 +80,12 @@ class CRM_Core_BAO_Log extends CRM_Core_DAO_Log { $log->save(); } + /** + * @param $contactID + * @param $tableName + * @param $tableID + * @param null $userID + */ static function register($contactID, $tableName, $tableID, diff --git a/CRM/Core/BAO/Mapping.php b/CRM/Core/BAO/Mapping.php index d2f5c43ea0..606dd28dec 100644 --- a/CRM/Core/BAO/Mapping.php +++ b/CRM/Core/BAO/Mapping.php @@ -939,6 +939,11 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping { * @relationshipTypeId related relationship type id * @return $groupTitle all custom field titles */ + /** + * @param $relationshipTypeId + * + * @return array + */ function getRelationTypeCustomGroupData($relationshipTypeId) { $customFields = CRM_Core_BAO_CustomField::getFields('Relationship', NULL, NULL, $relationshipTypeId, NULL, NULL); @@ -1103,6 +1108,11 @@ class CRM_Core_BAO_Mapping extends CRM_Core_DAO_Mapping { return $fields; } + /** + * @param $params + * + * @return array + */ static function &returnProperties(&$params) { $fields = array( 'contact_type' => 1, diff --git a/CRM/Core/BAO/MessageTemplate.php b/CRM/Core/BAO/MessageTemplate.php index 947fb4482f..bb11a9cebf 100644 --- a/CRM/Core/BAO/MessageTemplate.php +++ b/CRM/Core/BAO/MessageTemplate.php @@ -34,6 +34,10 @@ */ require_once 'Mail/mime.php'; + +/** + * Class CRM_Core_BAO_MessageTemplate + */ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate { /** @@ -152,6 +156,14 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate { return $msgTpls; } + /** + * @param $contactId + * @param $email + * @param $messageTemplateID + * @param $from + * + * @return bool|null + */ static function sendReminder($contactId, $email, $messageTemplateID, $from) { $messageTemplates = new CRM_Core_DAO_MessageTemplate(); diff --git a/CRM/Core/BAO/Navigation.php b/CRM/Core/BAO/Navigation.php index dca554d4ed..d2ad8f5edb 100644 --- a/CRM/Core/BAO/Navigation.php +++ b/CRM/Core/BAO/Navigation.php @@ -814,6 +814,11 @@ ORDER BY parent_id, weight"; } } + /** + * @param $cid + * + * @return object|string + */ static function getCacheKey($cid) { $key = CRM_Core_BAO_Setting::getItem( CRM_Core_BAO_Setting::PERSONAL_PREFERENCES_NAME, diff --git a/CRM/Core/BAO/Persistent.php b/CRM/Core/BAO/Persistent.php index b9bdba1f50..aabbdf5ba0 100644 --- a/CRM/Core/BAO/Persistent.php +++ b/CRM/Core/BAO/Persistent.php @@ -85,6 +85,12 @@ class CRM_Core_BAO_Persistent extends CRM_Core_DAO_Persistent { return $persistentDAO; } + /** + * @param $context + * @param null $name + * + * @return mixed + */ static function getContext($context, $name = NULL) { static $contextNameData = array(); diff --git a/CRM/Core/BAO/Phone.php b/CRM/Core/BAO/Phone.php index 539b2e5454..36c3c1f346 100644 --- a/CRM/Core/BAO/Phone.php +++ b/CRM/Core/BAO/Phone.php @@ -44,6 +44,12 @@ class CRM_Core_BAO_Phone extends CRM_Core_DAO_Phone { * * @param array $params input parameters */ + /** + * @param $params + * + * @return object + * @throws API_Exception + */ static function create($params) { // Ensure mysql phone function exists CRM_Core_DAO::checkSqlFunctionsExist(); diff --git a/CRM/Core/BAO/Preferences.php b/CRM/Core/BAO/Preferences.php index ea81418a5e..919cb970e9 100644 --- a/CRM/Core/BAO/Preferences.php +++ b/CRM/Core/BAO/Preferences.php @@ -38,6 +38,9 @@ */ class CRM_Core_BAO_Preferences { + /** + * @param $params + */ static function fixAndStoreDirAndURL(&$params) { $sql = " SELECT v.name as valueName, g.name as optionName @@ -74,6 +77,10 @@ AND v.is_active = 1 } } + /** + * @param $params + * @param string $type + */ static function storeDirectoryOrURLPreferences(&$params, $type = 'directory') { $optionName = ($type == 'directory') ? 'directory_preferences' : 'url_preferences'; @@ -103,6 +110,10 @@ AND v.name = %3 } } + /** + * @param $params + * @param bool $setInConfig + */ static function retrieveDirectoryAndURLPreferences(&$params, $setInConfig = FALSE) { if ($setInConfig) { $config = CRM_Core_Config::singleton(); diff --git a/CRM/Core/BAO/PrevNextCache.php b/CRM/Core/BAO/PrevNextCache.php index 3f7c53c17d..fd0fcd9511 100644 --- a/CRM/Core/BAO/PrevNextCache.php +++ b/CRM/Core/BAO/PrevNextCache.php @@ -38,6 +38,17 @@ */ class CRM_Core_BAO_PrevNextCache extends CRM_Core_DAO_PrevNextCache { + /** + * @param $cacheKey + * @param $id1 + * @param $id2 + * @param null $mergeId + * @param null $join + * @param null $where + * @param bool $flip + * + * @return array + */ static function getPositions($cacheKey, $id1, $id2, &$mergeId = NULL, $join = NULL, $where = NULL, $flip = FALSE) { if ($flip) { list($id1, $id2) = array($id2, $id1); @@ -100,6 +111,11 @@ WHERE cacheKey = %3 AND return $pos; } + /** + * @param null $id + * @param null $cacheKey + * @param string $entityTable + */ static function deleteItem($id = NULL, $cacheKey = NULL, $entityTable = 'civicrm_contact') { //clear cache @@ -118,6 +134,13 @@ WHERE cacheKey = %3 AND CRM_Core_DAO::executeQuery($sql, $params); } + /** + * @param $id1 + * @param $id2 + * @param null $cacheKey + * @param bool $isViceVersa + * @param string $entityTable + */ static function deletePair($id1, $id2, $cacheKey = NULL, $isViceVersa = FALSE, $entityTable = 'civicrm_contact') { $sql = "DELETE FROM civicrm_prevnext_cache WHERE entity_table = %1"; $params = array(1 => array($entityTable, 'String')); @@ -138,6 +161,15 @@ WHERE cacheKey = %3 AND CRM_Core_DAO::executeQuery($sql, $params); } + /** + * @param $cacheKey + * @param null $join + * @param null $where + * @param int $offset + * @param int $rowCount + * + * @return array + */ static function retrieve($cacheKey, $join = NULL, $where = NULL, $offset = 0, $rowCount = 0) { $query = " SELECT data @@ -173,10 +205,18 @@ WHERE cacheKey = %1 return $main; } + /** + * @param $string + * + * @return bool + */ public static function is_serialized($string) { return (@unserialize($string) !== false); } + /** + * @param $values + */ static function setItem($values) { $insert = "INSERT INTO civicrm_prevnext_cache ( entity_table, entity_id1, entity_id2, cacheKey, data ) VALUES \n"; $query = $insert . implode(",\n ", $values); @@ -185,6 +225,14 @@ WHERE cacheKey = %1 CRM_Core_DAO::executeQuery($query); } + /** + * @param $cacheKey + * @param null $join + * @param null $where + * @param string $op + * + * @return int + */ static function getCount($cacheKey, $join = NULL, $where = NULL, $op = "=") { $query = " SELECT COUNT(*) FROM civicrm_prevnext_cache pn @@ -199,6 +247,11 @@ WHERE cacheKey $op %1 return (int) CRM_Core_DAO::singleValueQuery($query, $params, TRUE, FALSE); } + /** + * @param null $rgid + * @param null $gid + * @param null $cacheKeyString + */ static function refillCache($rgid = NULL, $gid = NULL, $cacheKeyString = NULL) { if (!$cacheKeyString && $rgid) { $contactType = CRM_Core_DAO::getFieldValue('CRM_Dedupe_DAO_RuleGroup', $rgid, 'contact_type'); @@ -292,6 +345,12 @@ AND c.created_date < date_sub( NOW( ), INTERVAL %2 day ) * $action select - select a particular contact * unselect - unselect a particular contact */ + /** + * @param $cacheKey + * @param string $action + * @param null $cIds + * @param string $entity_table + */ static function markSelection($cacheKey, $action = 'unselect', $cIds = NULL, $entity_table = 'civicrm_contact') { if (!$cacheKey) { return; @@ -378,6 +437,9 @@ ORDER BY id } } + /** + * @return array + */ static function getSelectedContacts() { $qfKey = CRM_Utils_Request::retrieve('qfKey', 'String'); $cacheKey = "civicrm search {$qfKey}"; @@ -399,6 +461,12 @@ WHERE cacheKey LIKE %1 return $val; } + /** + * @param $obj + * @param $params + * + * @return mixed + */ static function buildSelectedContactPager( &$obj, &$params) { $params['status'] = ts('Contacts %%StatusMessage%%'); $params['csvString'] = NULL; diff --git a/CRM/Core/BAO/SchemaHandler.php b/CRM/Core/BAO/SchemaHandler.php index f79f9b7dd6..1853aa61d1 100644 --- a/CRM/Core/BAO/SchemaHandler.php +++ b/CRM/Core/BAO/SchemaHandler.php @@ -93,6 +93,11 @@ class CRM_Core_BAO_SchemaHandler { return TRUE; } + /** + * @param $params + * + * @return string + */ static function buildTableSQL(&$params) { $sql = "CREATE TABLE {$params['name']} ("; if (isset($params['fields']) && @@ -123,6 +128,13 @@ class CRM_Core_BAO_SchemaHandler { return $sql; } + /** + * @param $params + * @param $separator + * @param $prefix + * + * @return string + */ static function buildFieldSQL(&$params, $separator, $prefix) { $sql = ''; $sql .= $separator; @@ -151,6 +163,13 @@ class CRM_Core_BAO_SchemaHandler { return $sql; } + /** + * @param $params + * @param $separator + * @param $prefix + * + * @return null|string + */ static function buildPrimaryKeySQL(&$params, $separator, $prefix) { $sql = NULL; if (!empty($params['primary'])) { @@ -162,6 +181,14 @@ class CRM_Core_BAO_SchemaHandler { return $sql; } + /** + * @param $params + * @param $separator + * @param $prefix + * @param bool $indexExist + * + * @return null|string + */ static function buildSearchIndexSQL(&$params, $separator, $prefix, $indexExist = FALSE) { $sql = NULL; @@ -187,6 +214,13 @@ class CRM_Core_BAO_SchemaHandler { return $sql; } + /** + * @param $params + * @param $separator + * @param $prefix + * + * @return string + */ static function buildIndexSQL(&$params, $separator, $prefix) { $sql = ''; $sql .= $separator; @@ -213,6 +247,12 @@ class CRM_Core_BAO_SchemaHandler { return $sql; } + /** + * @param $tableName + * @param $fkTableName + * + * @return bool + */ static function changeFKConstraint($tableName, $fkTableName) { $fkName = "{$tableName}_entity_id"; if (strlen($fkName) >= 48) { @@ -235,6 +275,14 @@ ALTER TABLE {$tableName} return TRUE; } + /** + * @param $params + * @param $separator + * @param $prefix + * @param $tableName + * + * @return null|string + */ static function buildForeignKeySQL(&$params, $separator, $prefix, $tableName) { $sql = NULL; if (!empty($params['fk_table_name']) && !empty($params['fk_field_name'])) { @@ -252,6 +300,13 @@ ALTER TABLE {$tableName} return $sql; } + /** + * @param $params + * @param bool $indexExist + * @param bool $triggerRebuild + * + * @return bool + */ static function alterFieldSQL(&$params, $indexExist = FALSE, $triggerRebuild = TRUE) { $sql = str_repeat(' ', 8); $sql .= "ALTER TABLE {$params['table_name']}"; @@ -324,11 +379,19 @@ ALTER TABLE {$tableName} $dao = CRM_Core_DAO::executeQuery($sql); } + /** + * @param $tableName + * @param $columnName + */ static function dropColumn($tableName, $columnName) { $sql = "ALTER TABLE $tableName DROP COLUMN $columnName"; $dao = CRM_Core_DAO::executeQuery($sql); } + /** + * @param $tableName + * @param bool $dropUnique + */ static function changeUniqueToIndex($tableName, $dropUnique = TRUE) { if ($dropUnique) { $sql = "ALTER TABLE $tableName @@ -343,6 +406,11 @@ ADD UNIQUE INDEX `unique_entity_id` ( `entity_id` )"; $dao = CRM_Core_DAO::executeQuery($sql); } + /** + * @param $tables + * @param string $createIndexPrefix + * @param array $substrLenghts + */ static function createIndexes(&$tables, $createIndexPrefix = 'index', $substrLenghts = array( )) { $queries = array(); @@ -404,6 +472,14 @@ ADD UNIQUE INDEX `unique_entity_id` ( `entity_id` )"; } } + /** + * @param $customFieldID + * @param $tableName + * @param $columnName + * @param $length + * + * @throws Exception + */ static function alterFieldLength($customFieldID, $tableName, $columnName, $length) { // first update the custom field tables $sql = " diff --git a/CRM/Core/BAO/Setting.php b/CRM/Core/BAO/Setting.php index 1937dbb020..efa9aa4564 100644 --- a/CRM/Core/BAO/Setting.php +++ b/CRM/Core/BAO/Setting.php @@ -119,6 +119,15 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { $globalCache->delete($cacheKey); } + /** + * @param $values + * @param $group + * @param null $componentID + * @param null $contactID + * @param null $domainID + * + * @return string + */ static function setCache($values, $group, $componentID = NULL, @@ -139,6 +148,15 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { return $cacheKey; } + /** + * @param $group + * @param null $name + * @param null $componentID + * @param null $contactID + * @param null $domainID + * + * @return CRM_Core_DAO_Domain|CRM_Core_DAO_Setting + */ static function dao($group, $name = NULL, $componentID = NULL, @@ -810,6 +828,18 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { } } + /** + * @param $group + * @param $name + * @param bool $system + * @param null $userID + * @param bool $localize + * @param string $returnField + * @param bool $returnNameANDLabels + * @param null $condition + * + * @return array + */ static function valueOptions($group, $name, $system = TRUE, @@ -860,6 +890,14 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { return ($returnNameANDLabels) ? $nameAndLabels : $returnValues; } + /** + * @param $group + * @param $name + * @param $value + * @param bool $system + * @param null $userID + * @param string $keyField + */ static function setValueOption($group, $name, $value, @@ -896,6 +934,10 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { self::setItem($optionValue, $group, $name); } + /** + * @param $params + * @param null $domainID + */ static function fixAndStoreDirAndURL(&$params, $domainID = NULL) { if (self::isUpgradeFromPreFourOneAlpha1()) { return; @@ -967,6 +1009,10 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { } } + /** + * @param $params + * @param $group + */ static function storeDirectoryOrURLPreferences(&$params, $group) { foreach ($params as $name => $value) { // always try to store relative directory or url from CMS root @@ -976,6 +1022,10 @@ class CRM_Core_BAO_Setting extends CRM_Core_DAO_Setting { } } + /** + * @param $params + * @param bool $setInConfig + */ static function retrieveDirectoryAndURLPreferences(&$params, $setInConfig = FALSE) { if (CRM_Core_Config::isUpgradeMode()) { $isJoomla = (defined('CIVICRM_UF') && CIVICRM_UF == 'Joomla') ? TRUE : FALSE; diff --git a/CRM/Core/BAO/Tag.php b/CRM/Core/BAO/Tag.php index 7eb6748025..2aa097f503 100644 --- a/CRM/Core/BAO/Tag.php +++ b/CRM/Core/BAO/Tag.php @@ -65,6 +65,12 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { return NULL; } + /** + * @param null $usedFor + * @param bool $excludeHidden + * + * @return mixed + */ function getTree($usedFor = NULL, $excludeHidden = FALSE) { if (!isset($this->tree)) { $this->buildTree($usedFor, $excludeHidden); @@ -72,6 +78,10 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { return $this->tree; } + /** + * @param null $usedFor + * @param bool $excludeHidden + */ function buildTree($usedFor = NULL, $excludeHidden = FALSE) { $sql = "SELECT civicrm_tag.id, civicrm_tag.parent_id,civicrm_tag.name FROM civicrm_tag "; @@ -129,6 +139,14 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { } } + /** + * @param array $usedFor + * @param bool $buildSelect + * @param bool $all + * @param null $parentId + * + * @return array + */ static function getTagsUsedFor($usedFor = array('civicrm_contact'), $buildSelect = TRUE, $all = FALSE, @@ -182,6 +200,14 @@ class CRM_Core_BAO_Tag extends CRM_Core_DAO_Tag { return $tags; } + /** + * @param string $usedFor + * @param array $tags + * @param null $parentId + * @param string $separator + * + * @return array + */ static function getTags($usedFor = 'civicrm_contact', &$tags = array(), $parentId = NULL, diff --git a/CRM/Core/BAO/UFField.php b/CRM/Core/BAO/UFField.php index 843e97c38f..32045ba5f3 100644 --- a/CRM/Core/BAO/UFField.php +++ b/CRM/Core/BAO/UFField.php @@ -1082,6 +1082,9 @@ SELECT id return isset($availableFields[$fieldName]); } + /** + * @return array|null + */ static function getContribBatchEntryFields() { if (self::$_contriBatchEntryFields === NULL) { self::$_contriBatchEntryFields = array( @@ -1110,6 +1113,9 @@ SELECT id return self::$_contriBatchEntryFields; } + /** + * @return array|null + */ public static function getMemberBatchEntryFields() { if (self::$_memberBatchEntryFields === NULL) { self::$_memberBatchEntryFields = array( diff --git a/CRM/Core/BAO/UFGroup.php b/CRM/Core/BAO/UFGroup.php index 9448758c19..4ad97b78ab 100644 --- a/CRM/Core/BAO/UFGroup.php +++ b/CRM/Core/BAO/UFGroup.php @@ -612,6 +612,13 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup { return TRUE; } + /** + * @param $showAll + * @param $profileType + * @param $contactActivityProfile + * + * @return array + */ protected static function getImportableFields($showAll, $profileType, $contactActivityProfile) { if (!$showAll) { $importableFields = CRM_Contact_BAO_Contact::importableFields('All', FALSE, FALSE, FALSE, TRUE, TRUE); @@ -659,6 +666,11 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup { return $locationFields; } + /** + * @param $ctype + * + * @return mixed + */ protected static function getCustomFields($ctype) { static $customFieldCache = array(); if (!isset($customFieldCache[$ctype])) { @@ -3520,6 +3532,9 @@ SELECT group_id return $groupTypeValue; } + /** + * @return bool|object + */ static function isProfileDoubleOptin() { // check for double optin $config = CRM_Core_Config::singleton(); @@ -3531,6 +3546,9 @@ SELECT group_id return FALSE; } + /** + * @return bool|object + */ static function isProfileAddToGroupDoubleOptin() { // check for add to group double optin $config = CRM_Core_Config::singleton(); diff --git a/CRM/Core/BAO/UFJoin.php b/CRM/Core/BAO/UFJoin.php index 86c2165a58..da894ee1c5 100644 --- a/CRM/Core/BAO/UFJoin.php +++ b/CRM/Core/BAO/UFJoin.php @@ -66,6 +66,9 @@ class CRM_Core_BAO_UFJoin extends CRM_Core_DAO_UFJoin { return $dao; } + /** + * @param $params + */ public static function deleteAll(&$params) { $module = CRM_Utils_Array::value('module', $params); $entityTable = CRM_Utils_Array::value('entity_table', $params); @@ -145,6 +148,11 @@ class CRM_Core_BAO_UFJoin extends CRM_Core_DAO_UFJoin { return NULL; } + /** + * @param $params + * + * @return array + */ public static function getUFGroupIds(&$params) { $dao = new CRM_Core_DAO_UFJoin(); diff --git a/CRM/Core/BAO/UFMatch.php b/CRM/Core/BAO/UFMatch.php index 5b733dfe10..1630ece952 100644 --- a/CRM/Core/BAO/UFMatch.php +++ b/CRM/Core/BAO/UFMatch.php @@ -44,6 +44,11 @@ class CRM_Core_BAO_UFMatch extends CRM_Core_DAO_UFMatch { * * @param array $params input parameters */ + /** + * @param $params + * + * @return CRM_Core_DAO_UFMatch + */ static function create($params) { $hook = empty($params['id']) ? 'create' : 'edit'; CRM_Utils_Hook::pre($hook, 'UFMatch', CRM_Utils_Array::value('id', $params), $params); @@ -528,6 +533,9 @@ AND domain_id = %4 return NULL; } + /** + * @return bool + */ static function isEmptyTable() { $sql = "SELECT count(id) FROM civicrm_uf_match"; return CRM_Core_DAO::singleValueQuery($sql) > 0 ? FALSE : TRUE; @@ -593,6 +601,11 @@ AND domain_id = %4 return $ufId; } + /** + * @param $email + * + * @return bool + */ static function isDuplicateUser($email) { $session = CRM_Core_Session::singleton(); $contactID = $session->get('userID'); diff --git a/CRM/Core/BAO/WordReplacement.php b/CRM/Core/BAO/WordReplacement.php index f8008a290e..14b6083a4c 100644 --- a/CRM/Core/BAO/WordReplacement.php +++ b/CRM/Core/BAO/WordReplacement.php @@ -38,6 +38,15 @@ */ class CRM_Core_BAO_WordReplacement extends CRM_Core_DAO_WordReplacement { + /** + * class constructor + * + * @access public + * @return \CRM_Core_DAO_WordReplacement + */ + /** + * + */ function __construct() { parent::__construct(); } diff --git a/CRM/Core/CodeGen/BaseTask.php b/CRM/Core/CodeGen/BaseTask.php index a4cd151fb8..9fb779e207 100644 --- a/CRM/Core/CodeGen/BaseTask.php +++ b/CRM/Core/CodeGen/BaseTask.php @@ -1,5 +1,8 @@ type array + * @return array (associative) + */ function table() { $fields = &$this->fields(); diff --git a/CRM/Core/DAO/Factory.php b/CRM/Core/DAO/Factory.php index d2db1b9474..52fb080851 100644 --- a/CRM/Core/DAO/Factory.php +++ b/CRM/Core/DAO/Factory.php @@ -1,4 +1,8 @@ errorData['error_code']; } + + /** + * Return specific error information that can be used for more detailed + * error messages or translation. + * + * This method may be overridden in child exception classes in order + * to add functionality not present in PEAR_Exception and is a placeholder + * to define API + * + * The returned array must be an associative array of parameter => value like so: + *
+   * array('name' => $name, 'context' => array(...))
+   * 
+ * @return array + */ public function getErrorData() { return $this->errorData; } diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index 0cbcedd990..e32635b473 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -355,6 +355,13 @@ class CRM_Core_Form extends HTML_QuickForm_Page { */ function addRules() {} + /** + * Performs the server side validation + * @access public + * @since 1.0 + * @return boolean true if no error found + * @throws HTML_QuickForm_Error + */ function validate() { $error = parent::validate(); diff --git a/CRM/Core/I18n/Form.php b/CRM/Core/I18n/Form.php index 4f48db07b6..a03725abba 100644 --- a/CRM/Core/I18n/Form.php +++ b/CRM/Core/I18n/Form.php @@ -78,6 +78,15 @@ class CRM_Core_I18n_Form extends CRM_Core_Form { $this->assign('context', CRM_Utils_Request::retrieve('context', 'String', $this)); } + /** + * This virtual function is used to set the default values of + * various form elements + * + * access public + * + * @return array reference to the array of default values + * + */ function setDefaultValues() { return $this->_defaults; } diff --git a/CRM/Core/Page/Angular.php b/CRM/Core/Page/Angular.php index 6702e91171..71a60b3380 100644 --- a/CRM/Core/Page/Angular.php +++ b/CRM/Core/Page/Angular.php @@ -12,6 +12,13 @@ class CRM_Core_Page_Angular extends CRM_Core_Page { */ const DEFAULT_MODULE_WEIGHT = 200; + /** + * This function takes care of all the things common to all + * pages. This typically involves assigning the appropriate + * smarty variable :) + * + * @return string The content generated by running this page + */ function run() { $this->registerResources(CRM_Core_Resources::singleton()); return parent::run(); @@ -63,4 +70,4 @@ class CRM_Core_Page_Angular extends CRM_Core_Page { return $angularModules; } -} \ No newline at end of file +} diff --git a/CRM/Core/Payment/AuthorizeNetIPN.php b/CRM/Core/Payment/AuthorizeNetIPN.php index eb2e0e7d89..d3e5f59376 100644 --- a/CRM/Core/Payment/AuthorizeNetIPN.php +++ b/CRM/Core/Payment/AuthorizeNetIPN.php @@ -33,6 +33,9 @@ * */ class CRM_Core_Payment_AuthorizeNetIPN extends CRM_Core_Payment_BaseIPN { + /** + * Constructor + */ function __construct() { parent::__construct(); } diff --git a/CRM/Core/Payment/Google.php b/CRM/Core/Payment/Google.php index cd1ba9c0d9..ccf6796812 100644 --- a/CRM/Core/Payment/Google.php +++ b/CRM/Core/Payment/Google.php @@ -115,6 +115,15 @@ class CRM_Core_Payment_Google extends CRM_Core_Payment { } } + /** + * This function collects all the information from a web/api form and invokes + * the relevant payment processor specific functions to perform the transaction + * + * @param array $params assoc array of input parameters for this transaction + * + * @return array the result in an nice formatted array (or an error object) + * @abstract + */ function doDirectPayment(&$params) { CRM_Core_Error::fatal(ts('This function is not implemented')); } diff --git a/CRM/Core/Payment/IATS.php b/CRM/Core/Payment/IATS.php index a3417d87b6..a59884a75a 100644 --- a/CRM/Core/Payment/IATS.php +++ b/CRM/Core/Payment/IATS.php @@ -82,6 +82,15 @@ class CRM_Core_Payment_IATS extends CRM_Core_Payment { return self::$_singleton[$processorName]; } + /** + * This function collects all the information from a web/api form and invokes + * the relevant payment processor specific functions to perform the transaction + * + * @param array $params assoc array of input parameters for this transaction + * + * @return array the result in an nice formatted array (or an error object) + * @abstract + */ function doDirectPayment(&$params) { // $result = ''; // foreach($params as $key => $value) { diff --git a/CRM/Core/Payment/Moneris.php b/CRM/Core/Payment/Moneris.php index 5e68b7472d..d8c34a644f 100644 --- a/CRM/Core/Payment/Moneris.php +++ b/CRM/Core/Payment/Moneris.php @@ -96,6 +96,15 @@ class CRM_Core_Payment_Moneris extends CRM_Core_Payment { return self::$_singleton[$processorName]; } + /** + * This function collects all the information from a web/api form and invokes + * the relevant payment processor specific functions to perform the transaction + * + * @param array $params assoc array of input parameters for this transaction + * + * @return array the result in an nice formatted array (or an error object) + * @abstract + */ function doDirectPayment(&$params) { //make sure i've been called correctly ... if (!$this->_profile) { diff --git a/CRM/Core/Payment/PayJunction.php b/CRM/Core/Payment/PayJunction.php index 509d07774f..8487ab6896 100644 --- a/CRM/Core/Payment/PayJunction.php +++ b/CRM/Core/Payment/PayJunction.php @@ -70,6 +70,15 @@ class CRM_Core_Payment_PayJunction extends CRM_Core_Payment { * This function sends request and receives response from * PayJunction payment process */ + /** + * This function collects all the information from a web/api form and invokes + * the relevant payment processor specific functions to perform the transaction + * + * @param array $params assoc array of input parameters for this transaction + * + * @return array the result in an nice formatted array (or an error object) + * @abstract + */ function doDirectPayment(&$params) { $logon = $this->_paymentProcessor['user_name']; $password = $this->_paymentProcessor['password']; diff --git a/CRM/Core/Payment/PayPalIPN.php b/CRM/Core/Payment/PayPalIPN.php index b5ff373def..99274206c1 100644 --- a/CRM/Core/Payment/PayPalIPN.php +++ b/CRM/Core/Payment/PayPalIPN.php @@ -35,6 +35,10 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN { static $_paymentProcessor = NULL; + + /** + * Constructor + */ function __construct() { parent::__construct(); } diff --git a/CRM/Core/Payment/PayPalImpl.php b/CRM/Core/Payment/PayPalImpl.php index cc05ff780e..bb2b3d1ae4 100644 --- a/CRM/Core/Payment/PayPalImpl.php +++ b/CRM/Core/Payment/PayPalImpl.php @@ -412,6 +412,14 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { } } + /** + * Function to check whether a method is present ( & supported ) by the payment processor object. + * + * @param string $method method to check for. + * + * @return boolean + * @public + */ function isSupported($method = 'cancelSubscription') { if ($this->_paymentProcessor['payment_processor_type'] != 'PayPal') { // since subscription methods like cancelSubscription or updateBilling is not yet implemented / supported diff --git a/CRM/Core/Payment/PayflowPro.php b/CRM/Core/Payment/PayflowPro.php index 27d3a7eae2..43b0993ff1 100644 --- a/CRM/Core/Payment/PayflowPro.php +++ b/CRM/Core/Payment/PayflowPro.php @@ -59,7 +59,16 @@ class CRM_Core_Payment_PayflowPro extends CRM_Core_Payment { * the processor. It is the main function for processing on-server * credit card transactions */ - function doDirectPayment(&$params) { + /** + * This function collects all the information from a web/api form and invokes + * the relevant payment processor specific functions to perform the transaction + * + * @param array $params assoc array of input parameters for this transaction + * + * @return array the result in an nice formatted array (or an error object) + * @abstract + */ + function doDirectPayment(&$params) { if (!defined('CURLOPT_SSLCERT')) { CRM_Core_Error::fatal(ts('PayFlowPro requires curl with SSL support')); } @@ -400,6 +409,14 @@ class CRM_Core_Payment_PayflowPro extends CRM_Core_Payment { // function checkConfig( $mode ) // CiviCRM V1.9 Declaration // CiviCRM V2.0 Declaration + /** + * This function checks to see if we have the right config values + * + * @internal param string $mode the mode we are operating in (live or test) + * + * @return string the error message if any + * @public + */ function checkConfig() { $errorMsg = array(); if (empty($this->_paymentProcessor['user_name'])) { diff --git a/CRM/Core/Payment/PaymentExpress.php b/CRM/Core/Payment/PaymentExpress.php index 7160b8758b..2efa379d4c 100644 --- a/CRM/Core/Payment/PaymentExpress.php +++ b/CRM/Core/Payment/PaymentExpress.php @@ -82,6 +82,14 @@ class CRM_Core_Payment_PaymentExpress extends CRM_Core_Payment { return self::$_singleton[$processorName]; } + /** + * This function checks to see if we have the right config values + * + * @internal param string $mode the mode we are operating in (live or test) + * + * @return string the error message if any + * @public + */ function checkConfig() { $config = CRM_Core_Config::singleton(); @@ -115,6 +123,15 @@ class CRM_Core_Payment_PaymentExpress extends CRM_Core_Payment { CRM_Core_Error::fatal(ts('This function is not implemented')); } + /** + * This function collects all the information from a web/api form and invokes + * the relevant payment processor specific functions to perform the transaction + * + * @param array $params assoc array of input parameters for this transaction + * + * @return array the result in an nice formatted array (or an error object) + * @abstract + */ function doDirectPayment(&$params) { CRM_Core_Error::fatal(ts('This function is not implemented')); } diff --git a/CRM/Core/Permission/UnitTests.php b/CRM/Core/Permission/UnitTests.php index 6dde7d5cff..c083e73ec6 100644 --- a/CRM/Core/Permission/UnitTests.php +++ b/CRM/Core/Permission/UnitTests.php @@ -41,6 +41,14 @@ class CRM_Core_Permission_UnitTests extends CRM_Core_Permission_Base { // permission mapping to stub check() calls public $permissions = NULL; + /** + * given a permission string, check for access requirements + * + * @param string $str the permission to check + * + * @return boolean true if yes, else false + * @access public + */ function check($str) { // return the stubbed permission (defaulting to true if the array is missing) return is_array($this->permissions) ? in_array($str, $this->permissions) : TRUE; diff --git a/CRM/Core/QuickForm/GroupMultiSelect.php b/CRM/Core/QuickForm/GroupMultiSelect.php index bca28f893b..152b2c6bd1 100644 --- a/CRM/Core/QuickForm/GroupMultiSelect.php +++ b/CRM/Core/QuickForm/GroupMultiSelect.php @@ -34,6 +34,13 @@ * */ class CRM_Core_QuickForm_GroupMultiSelect extends CRM_Core_QuickForm_NestedAdvMultiSelect { + /** + * Returns the HTML generated for the advanced mutliple select component + * + * @access public + * @return string + * @since version 0.4.0 (2005-06-25) + */ function toHtml() { if ($this->_flagFrozen) { return $this->getFrozenHtml(); diff --git a/CRM/Core/QuickForm/NestedAdvMultiSelect.php b/CRM/Core/QuickForm/NestedAdvMultiSelect.php index 50e2083148..f148e4ab07 100644 --- a/CRM/Core/QuickForm/NestedAdvMultiSelect.php +++ b/CRM/Core/QuickForm/NestedAdvMultiSelect.php @@ -36,6 +36,24 @@ require_once 'HTML/QuickForm/advmultiselect.php'; class CRM_Core_QuickForm_NestedAdvMultiSelect extends HTML_QuickForm_advmultiselect { + /** + * Loads options from different types of data sources + * + * This method overloaded parent method of select element, to allow + * loading options with fancy attributes. + * + * @param mixed &$options Options source currently supports assoc array or DB_result + * @param mixed $param1 (optional) See function detail + * @param mixed $param2 (optional) See function detail + * @param mixed $param3 (optional) See function detail + * @param mixed $param4 (optional) See function detail + * + * @access public + * @since version 1.5.0 (2009-02-15) + * @return PEAR_Error|NULL on error and TRUE on success + * @throws PEAR_Error + * @see loadArray() + */ function load(&$options, $param1 = NULL, $param2 = NULL, $param3 = NULL, $param4 = NULL ) { diff --git a/CRM/Core/Reference/Interface.php b/CRM/Core/Reference/Interface.php index e4cb7e5ecb..169de419d2 100644 --- a/CRM/Core/Reference/Interface.php +++ b/CRM/Core/Reference/Interface.php @@ -1,4 +1,8 @@