INFRA-132 - Comment grammar cleanup
[civicrm-core.git] / CRM / Core / BAO / Website.php
index 69befbbba84e88a354341b74e780ebd8116d5c29..ff08619fd1167c1996e17673ffdb7afd79b01d6d 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | 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$
  *
  */
 class CRM_Core_BAO_Website extends CRM_Core_DAO_Website {
 
   /**
-   * takes an associative array and adds im
+   * Takes an associative array and adds im
    *
-   * @param array  $params         (reference ) an assoc array of name/value pairs
+   * @param array $params
+   *   (reference ) an assoc array of name/value pairs.
    *
    * @return object       CRM_Core_BAO_Website object on success, null otherwise
-   * @access public
    * @static
    */
-  static function add(&$params) {
+  public static function add(&$params) {
     $hook = empty($params['id']) ? 'create' : 'edit';
     CRM_Utils_Hook::pre($hook, 'Website', CRM_Utils_Array::value('id', $params), $params);
 
@@ -60,16 +60,19 @@ class CRM_Core_BAO_Website extends CRM_Core_DAO_Website {
   }
 
   /**
-   * process website
+   * Process website
    *
-   * @param array $params associated array
-   * @param int   $contactID contact id
+   * @param array $params
+   *   Associated array.
+   * @param int $contactID
+   *   Contact id.
+   *
+   * @param $skipDelete
    *
    * @return void
-   * @access public
    * @static
    */
-  static function create(&$params, $contactID, $skipDelete) {
+  public static function create(&$params, $contactID, $skipDelete) {
     if (empty($params)) {
       return FALSE;
     }
@@ -86,12 +89,11 @@ class CRM_Core_BAO_Website extends CRM_Core_DAO_Website {
         }
       }
 
-      if (!CRM_Utils_Array::value('id', $values) &&
+      if (empty($values['id']) &&
         is_array($ids) && !empty($ids)
       ) {
         foreach ($ids as $id => $value) {
-          if (($value['website_type_id'] == $values['website_type_id'])
-            && CRM_Utils_Array::value('url', $value)) {
+          if (($value['website_type_id'] == $values['website_type_id']) && !empty($values['url'])) {
             $values['id'] = $id;
             unset($ids[$id]);
             break;
@@ -99,7 +101,7 @@ class CRM_Core_BAO_Website extends CRM_Core_DAO_Website {
         }
       }
       $values['contact_id'] = $contactID;
-      if ( CRM_Utils_Array::value('url', $values) ) {
+      if (!empty($values['url'])) {
         self::add($values);
       }
     }
@@ -112,12 +114,13 @@ class CRM_Core_BAO_Website extends CRM_Core_DAO_Website {
   /**
    * Delete website
    *
-   * @param array $ids website ids
+   * @param array $ids
+   *   Website ids.
    *
    * @return void
    * @static
    */
-  static function del($ids) {
+  public static function del($ids) {
     $query = 'DELETE FROM civicrm_website WHERE id IN ( ' . implode(',', $ids) . ')';
     CRM_Core_DAO::executeQuery($query);
     // FIXME: we should return false if the del was unsuccessful
@@ -128,13 +131,13 @@ class CRM_Core_BAO_Website extends CRM_Core_DAO_Website {
    * Given the list of params in the params array, fetch the object
    * and store the values in the values array
    *
-   * @param array entityBlock input parameters to find object
+   * @param array $params
+   * @param $values
    *
    * @return boolean
-   * @access public
    * @static
    */
-  static function &getValues(&$params, &$values) {
+  public static function &getValues(&$params, &$values) {
     $websites            = array();
     $website             = new CRM_Core_DAO_Website();
     $website->contact_id = $params['contact_id'];
@@ -155,13 +158,15 @@ class CRM_Core_BAO_Website extends CRM_Core_DAO_Website {
   /**
    * Get all the websites for a specified contact_id
    *
-   * @param int $id the contact id
+   * @param int $id
+   *   The contact id.
+   *
+   * @param bool $updateBlankLocInfo
    *
    * @return array  the array of website details
-   * @access public
    * @static
    */
-  static function allWebsites($id, $updateBlankLocInfo = FALSE) {
+  public static function allWebsites($id, $updateBlankLocInfo = FALSE) {
     if (!$id) {
       return NULL;
     }
@@ -191,4 +196,3 @@ SELECT  id, website_type_id
     return $websites;
   }
 }
-