Merge pull request #3794 from rohankatkar/CRM-15070
[civicrm-core.git] / CRM / Core / BAO / CustomValueTable.php
index cd52496a9365261ac9416589d177ff22ff9c736e..2cb38118fdb0efc4b423d88af632a6a70b562586 100644 (file)
  */
 class CRM_Core_BAO_CustomValueTable {
 
+  /**
+   * @param $customParams
+   *
+   * @throws Exception
+   */
   static function create(&$customParams) {
     if (empty($customParams) ||
       !is_array($customParams)
@@ -250,6 +255,8 @@ class CRM_Core_BAO_CustomValueTable {
    *
    * @param string $type the civicrm type string
    *
+   * @param int $maxLength
+   *
    * @return the mysql data store placeholder
    * @access public
    * @static
@@ -298,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) {
@@ -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,
@@ -471,6 +490,9 @@ AND    $cond
    *
    * @array $params
    *
+   * @param $params
+   *
+   * @throws Exception
    * @return array
    * @static
    */
@@ -573,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();
         }
@@ -609,6 +635,9 @@ AND    cf.id IN ( $fieldIDList )
    *
    * @array $params
    *
+   * @param $params
+   *
+   * @throws Exception
    * @return array
    * @static
    */