Update Copywrite year to be 2019
[civicrm-core.git] / CRM / Contact / BAO / GroupNesting.php
index 284aa3a1bf400708c7038949f0f9af4573b629c4..615b9a0e97dba182d12410ff724b8fb8f65da72c 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.7                                                |
+ | CiviCRM version 5                                                  |
  +--------------------------------------------------------------------+
  | Copyright U.S. PIRG Education Fund (c) 2007                        |
  | Licensed to CiviCRM under the Academic Free License version 3.0.   |
  */
 class CRM_Contact_BAO_GroupNesting extends CRM_Contact_DAO_GroupNesting {
 
+  /**
+   * Add Dashboard.
+   *
+   * @param array $params
+   *   Values.
+   *
+   *
+   * @return object
+   */
+  public static function create($params) {
+    $hook = empty($params['id']) ? 'create' : 'edit';
+    CRM_Utils_Hook::pre($hook, 'GroupNesting', CRM_Utils_Array::value('id', $params), $params);
+    $dao = new CRM_Contact_BAO_GroupNesting();
+    $dao->copyValues($params);
+    if (empty($params['id'])) {
+      $dao->find(TRUE);
+    }
+    $dao->save();
+    CRM_Utils_Hook::post($hook, 'GroupNesting', $dao->id, $dao);
+    return $dao;
+  }
+
   /**
    * Adds a new group nesting record.
    *