X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FBAO%2FIM.php;h=2f3830d419f220258cc2c9951783424cf7a5de60;hb=fb1b8b9d4c10122a89f2e017497071a734496fe6;hp=9e4f1757dd9205b8cd44e3e1a37a85e00a887795;hpb=fa92b4af1c4abf280689cea6445c7a9b99858831;p=civicrm-core.git diff --git a/CRM/Core/BAO/IM.php b/CRM/Core/BAO/IM.php index 9e4f1757dd..2f3830d419 100644 --- a/CRM/Core/BAO/IM.php +++ b/CRM/Core/BAO/IM.php @@ -23,7 +23,7 @@ | GNU Affero General Public License or the licensing of CiviCRM, | | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ -*/ + */ /** * @@ -39,12 +39,13 @@ class CRM_Core_BAO_IM extends CRM_Core_DAO_IM { /** - * Takes an associative array and adds im + * Takes an associative array and adds im. * - * @param array $params (reference ) an assoc array of name/value pairs + * @param array $params + * (reference ) an assoc array of name/value pairs. * - * @return object CRM_Core_BAO_IM object on success, null otherwise - * @static + * @return object + * CRM_Core_BAO_IM object on success, null otherwise */ public static function add(&$params) { $hook = empty($params['id']) ? 'create' : 'edit'; @@ -62,10 +63,9 @@ class CRM_Core_BAO_IM extends CRM_Core_DAO_IM { * Given the list of params in the params array, fetch the object * and store the values in the values array * - * @param array entityBlock input parameters to find object + * @param array $entityBlock input parameters to find object * - * @return boolean - * @static + * @return bool */ public static function &getValues($entityBlock) { return CRM_Core_BAO_Block::getValues('im', $entityBlock); @@ -74,12 +74,13 @@ class CRM_Core_BAO_IM extends CRM_Core_DAO_IM { /** * Get all the ims for a specified contact_id, with the primary im being first * - * @param int $id the contact id + * @param int $id + * The contact id. * * @param bool $updateBlankLocInfo * - * @return array the array of im details - * @static + * @return array + * the array of im details */ public static function allIMs($id, $updateBlankLocInfo = FALSE) { if (!$id) { @@ -99,8 +100,8 @@ ORDER BY civicrm_im.is_primary DESC, im_id ASC "; $params = array(1 => array($id, 'Integer')); - $ims = $values = array(); - $dao = CRM_Core_DAO::executeQuery($query, $params); + $ims = $values = array(); + $dao = CRM_Core_DAO::executeQuery($query, $params); $count = 1; while ($dao->fetch()) { $values = array( @@ -125,22 +126,19 @@ ORDER BY /** * Get all the ims for a specified location_block id, with the primary im being first * - * @param array $entityElements the array containing entity_id and - * entity_table name + * @param array $entityElements + * The array containing entity_id and. + * entity_table name * - * @return array the array of im details - * @static + * @return array + * the array of im details */ public static function allEntityIMs(&$entityElements) { if (empty($entityElements)) { return NULL; } - - $entityId = $entityElements['entity_id']; $entityTable = $entityElements['entity_table']; - - $sql = "SELECT cim.name as im, ltype.name as locationType, cim.is_primary as is_primary, cim.id as im_id, cim.location_type_id as locationTypeId FROM civicrm_loc_block loc, civicrm_im cim, civicrm_location_type ltype, {$entityTable} ev WHERE ev.id = %1 @@ -166,9 +164,10 @@ ORDER BY cim.is_primary DESC, im_id ASC "; } /** - * Call common delete function + * Call common delete function. */ public static function del($id) { return CRM_Contact_BAO_Contact::deleteObjectWithPrimary('IM', $id); } + }