Merge remote-tracking branch 'upstream/4.4' into 4.4-master-2014-04-07-15-32-51
[civicrm-core.git] / CRM / Contact / BAO / ContactType.php
index 62719aa01ee66af4fba98b0ca8721d3b643805dd..67524c32da96a16c374fcc854520a90cbbff8237 100644 (file)
@@ -1,9 +1,9 @@
 <?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.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
  *
  */
@@ -588,10 +588,10 @@ WHERE name = %1";
   static function add($params) {
 
     // label or name
-    if (!CRM_Utils_Array::value('label', $params)) {
+    if (empty($params['label'])) {
       return;
     }
-    if (CRM_Utils_Array::value('parent_id', $params) &&
+    if (!empty($params['parent_id']) &&
       !CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_ContactType', $params['parent_id'])
     ) {
       return;
@@ -609,7 +609,7 @@ WHERE name = %1";
       $active      = $contactType->is_active;
     }
 
-    if (CRM_Utils_Array::value('id', $params)) {
+    if (!empty($params['id'])) {
       $params = array('name' => "New $contactName");
       $newParams = array(
         'label' => "New $contact",