Update copyright date for 2020
[civicrm-core.git] / CRM / Core / BAO / Website.php
index 29e118b95848be2e794f03c2de1537ef8294d5c0..bf3bffda3785d9c67f65621f976fbe8e9d856be0 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 5                                                  |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2019                                |
+ | Copyright CiviCRM LLC (c) 2004-2020                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,7 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2019
+ * @copyright CiviCRM LLC (c) 2004-2020
  */
 
 /**
@@ -141,7 +141,6 @@ class CRM_Core_BAO_Website extends CRM_Core_DAO_Website {
       return FALSE;
     }
     CRM_Utils_Hook::post('delete', 'Website', $id, $obj);
-    $obj->free();
     return TRUE;
   }
 
@@ -154,15 +153,15 @@ class CRM_Core_BAO_Website extends CRM_Core_DAO_Website {
    *
    * @return bool
    */
-  public static function &getValues(&$params, &$values) {
-    $websites = array();
+  public static function &getValues(&$params = [], &$values = []) {
+    $websites = [];
     $website = new CRM_Core_DAO_Website();
     $website->contact_id = $params['contact_id'];
     $website->find();
 
     $count = 1;
     while ($website->fetch()) {
-      $values['website'][$count] = array();
+      $values['website'][$count] = [];
       CRM_Core_DAO::storeValues($website, $values['website'][$count]);
 
       $websites[$count] = $values['website'][$count];
@@ -192,16 +191,16 @@ class CRM_Core_BAO_Website extends CRM_Core_DAO_Website {
 SELECT  id, website_type_id
   FROM  civicrm_website
  WHERE  civicrm_website.contact_id = %1';
-    $params = array(1 => array($id, 'Integer'));
+    $params = [1 => [$id, 'Integer']];
 
-    $websites = $values = array();
+    $websites = $values = [];
     $dao = CRM_Core_DAO::executeQuery($query, $params);
     $count = 1;
     while ($dao->fetch()) {
-      $values = array(
+      $values = [
         'id' => $dao->id,
         'website_type_id' => $dao->website_type_id,
-      );
+      ];
 
       if ($updateBlankLocInfo) {
         $websites[$count++] = $values;