<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
*/
public static function handlePrimary(&$params, $class) {
$table = CRM_Core_DAO_AllCoreTables::getTableForClass($class);
+ if (!$table) {
+ throw new API_Exception("Failed to locate table for class [$class]");
+ }
+
// contact_id in params might be empty or the string 'null' so cast to integer
$contactId = (int) CRM_Utils_Array::value('contact_id', $params);
// If id is set & we haven't been passed a contact_id, retrieve it