X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FBAO%2FCustomValueTable.php;h=2cb38118fdb0efc4b423d88af632a6a70b562586;hb=b48a37b4f830f20c3d0fd28ada9a9e2a30356f47;hp=011116f98eb4f3aaaba8d09150caaecf08f297ed;hpb=ca5bec87585757261df111b0ba58a4c236ac2cf8;p=civicrm-core.git diff --git a/CRM/Core/BAO/CustomValueTable.php b/CRM/Core/BAO/CustomValueTable.php index 011116f98e..2cb38118fd 100644 --- a/CRM/Core/BAO/CustomValueTable.php +++ b/CRM/Core/BAO/CustomValueTable.php @@ -1,9 +1,9 @@ $param) { @@ -320,7 +332,7 @@ class CRM_Core_BAO_CustomValueTable { $cvParam['type'] = 'Timestamp'; } - if (CRM_Utils_Array::value('id', $customValue)) { + if (!empty($customValue['id'])) { $cvParam['id'] = $customValue['id']; } if (!array_key_exists($customValue['table_name'], $cvParams)) { @@ -339,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, @@ -354,16 +373,18 @@ class CRM_Core_BAO_CustomValueTable { /** * Return an array of all custom values associated with an entity. * - * @param int $entityID Identification number of the entity - * @param string $entityType Type of entity that the entityID corresponds to, specified + * @param int $entityID Identification number of the entity + * @param string $entityType Type of entity that the entityID corresponds to, specified * as a string with format "''". Comma separated * list may be used to specify OR matches. Allowable values * are enumerated types in civicrm_custom_group.extends field. * Optional. Default value assumes entityID references a * contact entity. - * @param array $fieldIDs optional list of fieldIDs that we want to retrieve. If this + * @param array $fieldIDs optional list of fieldIDs that we want to retrieve. If this * is set the entityType is ignored * + * @param bool $formatMultiRecordField + * * @return array $fields Array of custom values for the entity with key=>value * pairs specified as civicrm_custom_field.id => custom value. * Empty array if no custom values found. @@ -420,7 +441,7 @@ AND $cond $fields[$dao->table_name][] = $dao->fieldID; $select[$dao->table_name][] = "{$dao->column_name} AS custom_{$dao->fieldID}"; $isMultiple[$dao->table_name] = $dao->is_multiple ? TRUE : FALSE; - $file[$dao->table_name][$dao->fieldID] = $dao->fieldDataType; + $file[$dao->table_name][$dao->fieldID] = $dao->fieldDataType; } $result = array(); @@ -453,7 +474,7 @@ AND $cond } } else { - $result[$fieldID] = $dao->$fieldName; + $result[$fieldID] = $dao->$fieldName; } } } @@ -469,6 +490,9 @@ AND $cond * * @array $params * + * @param $params + * + * @throws Exception * @return array * @static */ @@ -571,6 +595,10 @@ AND cf.id IN ( $fieldIDList ) 'is_multiple' => $dao->is_multiple, ); + if ($cvParam['type'] == 'File') { + $cvParam['file_id'] = $fieldValue['value']; + } + if (!array_key_exists($dao->table_name, $cvParams)) { $cvParams[$dao->table_name] = array(); } @@ -607,6 +635,9 @@ AND cf.id IN ( $fieldIDList ) * * @array $params * + * @param $params + * + * @throws Exception * @return array * @static */