<?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$
*
*/
/**
* Function to create various elements of location block
*
- * @param array $params (reference ) an assoc array of name/value pairs
- * @param boolean $fixAddress true if you need to fix (format) address values
+ * @param array $params (reference ) an assoc array of name/value pairs
+ * @param boolean $fixAddress true if you need to fix (format) address values
* before inserting in db
*
+ * @param null $entity
+ *
* @return array $location
* @access public
* @static
foreach (array(
'phone', 'email', 'im', 'address') as $loc) {
- $locBlock["{$loc}_id"] = CRM_Utils_Array::value(0, $location["$loc"]) ? $location["$loc"][0]->id : NULL;
- $locBlock["{$loc}_2_id"] = CRM_Utils_Array::value(1, $location["$loc"]) ? $location["$loc"][1]->id : NULL;
+ $locBlock["{$loc}_id"] = !empty($location["$loc"][0]) ? $location["$loc"][0]->id : NULL;
+ $locBlock["{$loc}_2_id"] = !empty($location["$loc"][1]) ? $location["$loc"][1]->id : NULL;
}
$countNull = 0;
* Given the list of params in the params array, fetch the object
* and store the values in the values array
*
- * @param array $params input parameters to find object
- * @param array $values output values of the object
+ * @param $entityBlock
+ * @param bool $microformat
+ *
+ * @internal param array $params input parameters to find object
+ * @internal param array $values output values of the object
*
* @return array array of objects(CRM_Core_BAO_Location)
* @access public
* @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();