Merge pull request #5145 from agh1/case-insensitive-headers
[civicrm-core.git] / CRM / Core / BAO / Domain.php
index 6cb255d2bb70b60318470659c9ff355e445b74b2..9cdb9a0ba02727fb64af59e50dffd8e401022955 100644 (file)
@@ -23,7 +23,7 @@
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
@@ -39,7 +39,7 @@
 class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain {
 
   /**
-   * Cache for the current domain object
+   * Cache for the current domain object.
    */
   static $_domain = NULL;
 
@@ -49,27 +49,25 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain {
   private $_location = NULL;
 
   /**
-   * Fetch object based on array of properties
+   * Fetch object based on array of properties.
    *
    * @param array $params
    *   (reference ) an assoc array of name/value pairs.
    * @param array $defaults
    *   (reference ) an assoc array to hold the flattened values.
    *
-   * @return CRM_Core_DAO_Domain object
-   * @static
+   * @return CRM_Core_DAO_Domain
    */
   public static function retrieve(&$params, &$defaults) {
     return CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_Domain', $params, $defaults);
   }
 
   /**
-   * Get the domain BAO
+   * Get the domain BAO.
    *
    * @param null $reset
    *
-   * @return null|object CRM_Core_BAO_Domain
-   * @static
+   * @return CRM_Core_BAO_Domain|null
    */
   public static function &getDomain($reset = NULL) {
     static $domain = NULL;
@@ -131,17 +129,16 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain {
   }
 
   /**
-   * Get the location values of a domain
-   *
-   * @param NULL
+   * Get the location values of a domain.
    *
-   * @return array        Location::getValues
+   * @return array
+   *   Location::getValues
    */
   public function &getLocationValues() {
     if ($this->_location == NULL) {
       $domain = self::getDomain(NULL);
       $params = array(
-        'contact_id' => $domain->contact_id
+        'contact_id' => $domain->contact_id,
       );
       $this->_location = CRM_Core_BAO_Location::getValues($params, TRUE);
 
@@ -153,12 +150,13 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain {
   }
 
   /**
-   * Save the values of a domain
+   * Save the values of a domain.
    *
    * @param array $params
    * @param int $id
    *
-   * @return array domain
+   * @return array
+   *   domain
    */
   public static function edit(&$params, &$id) {
     $domain = new CRM_Core_DAO_Domain();
@@ -169,11 +167,12 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain {
   }
 
   /**
-   * Create a new domain
+   * Create a new domain.
    *
    * @param array $params
    *
-   * @return array domain
+   * @return array
+   *   domain
    */
   public static function create($params) {
     $domain = new CRM_Core_DAO_Domain();
@@ -200,16 +199,17 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain {
   /**
    * @param bool $skipFatal
    *
-   * @return array name & email for domain
+   * @return array
+   *   name & email for domain
    * @throws Exception
    */
   public static function getNameAndEmail($skipFatal = FALSE) {
     $fromEmailAddress = CRM_Core_OptionGroup::values('from_email_address', NULL, NULL, NULL, ' AND is_default = 1');
     if (!empty($fromEmailAddress)) {
       foreach ($fromEmailAddress as $key => $value) {
-        $email     = CRM_Utils_Mail::pluckEmailFromHeader($value);
+        $email = CRM_Utils_Mail::pluckEmailFromHeader($value);
         $fromArray = explode('"', $value);
-        $fromName  = CRM_Utils_Array::value(1, $fromArray);
+        $fromName = CRM_Utils_Array::value(1, $fromArray);
         break;
       }
       return array($fromName, $email);
@@ -331,4 +331,5 @@ class CRM_Core_BAO_Domain extends CRM_Core_DAO_Domain {
     }
     return $siteContacts;
   }
+
 }