<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
class CRM_Core_BAO_CustomValueTable {
+ /**
+ * @param $customParams
+ *
+ * @throws Exception
+ */
static function create(&$customParams) {
if (empty($customParams) ||
!is_array($customParams)
CRM_Utils_Array::lookupValue($states, 'state_province',
CRM_Core_PseudoConstant::stateProvince(), TRUE
);
- if (!CRM_Utils_Array::value('state_province_id', $states)) {
+ if (empty($states['state_province_id'])) {
CRM_Utils_Array::lookupValue($states, 'state_province',
CRM_Core_PseudoConstant::stateProvinceAbbreviation(), TRUE
);
CRM_Utils_Array::lookupValue($countries, 'country',
CRM_Core_PseudoConstant::country(), TRUE
);
- if (!CRM_Utils_Array::value('country_id', $countries)) {
+ if (empty($countries['country_id'])) {
CRM_Utils_Array::lookupValue($countries, 'country',
CRM_Core_PseudoConstant::countryIsoCode(), TRUE
);
*
* @param string $type the civicrm type string
*
+ * @param int $maxLength
+ *
* @return the mysql data store placeholder
* @access public
* @static
}
}
+ /**
+ * @param $params
+ * @param $entityTable
+ * @param $entityID
+ */
static function store(&$params, $entityTable, $entityID) {
$cvParams = array();
foreach ($params as $fieldID => $param) {
$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)) {
}
}
+ /**
+ * @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,
/**
* 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 "'<EntityName>'". 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.
$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();
}
}
else {
- $result[$fieldID] = $dao->$fieldName;
+ $result[$fieldID] = $dao->$fieldName;
}
}
}
*
* @array $params
*
+ * @param $params
+ *
+ * @throws Exception
* @return array
* @static
*/
'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();
}
*
* @array $params
*
+ * @param $params
+ *
+ * @throws Exception
* @return array
* @static
*/