class CRM_Core_BAO_IM extends CRM_Core_DAO_IM {
/**
- * Takes an associative array and adds im.
+ * Create or update IM record.
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
- *
- * @return object
- * CRM_Core_BAO_IM object on success, null otherwise
+ * @return CRM_Core_DAO_IM
*/
- public static function add(&$params) {
- $hook = empty($params['id']) ? 'create' : 'edit';
- CRM_Utils_Hook::pre($hook, 'IM', CRM_Utils_Array::value('id', $params), $params);
-
- $im = new CRM_Core_DAO_IM();
- $im->copyValues($params);
- $im->save();
-
- CRM_Utils_Hook::post($hook, 'IM', $im->id, $im);
- return $im;
+ public static function add($params) {
+ return self::writeRecord($params);
}
/**