<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
/**
* 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
+ * @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
- * @access public
* @static
*/
- static function retrieve(&$params, &$defaults) {
+ public static function retrieve(&$params, &$defaults) {
return CRM_Core_DAO::commonRetrieve('CRM_Core_DAO_Domain', $params, $defaults);
}
* @param null $reset
*
* @return null|object CRM_Core_BAO_Domain
- * @access public
* @static
*/
- static function &getDomain($reset = null) {
+ public static function &getDomain($reset = NULL) {
static $domain = NULL;
if (!$domain || $reset) {
$domain = new CRM_Core_BAO_Domain();
return $domain;
}
- /**
- * Change active domain (ie. to perform a temporary action) such as changing
- * config for all domains
- *
- * Switching around the global domain variable is very risky business. This
- * is ONLY used as a hack to allow CRM_Core_BAO_Setting::setItems to manipulate
- * the civicrm_domain.config_backend in multiple domains. When/if config_backend
- * goes away, this hack should be removed.
- *
- * @param integer $domainID id for domain you want to set as current
- * @deprecated
- * @see http://issues.civicrm.org/jira/browse/CRM-11204
- */
- static function setDomain($domainID) {
+ /**
+ * Change active domain (ie. to perform a temporary action) such as changing
+ * config for all domains
+ *
+ * Switching around the global domain variable is very risky business. This
+ * is ONLY used as a hack to allow CRM_Core_BAO_Setting::setItems to manipulate
+ * the civicrm_domain.config_backend in multiple domains. When/if config_backend
+ * goes away, this hack should be removed.
+ *
+ * @param int $domainID
+ * Id for domain you want to set as current.
+ * @deprecated
+ * @see http://issues.civicrm.org/jira/browse/CRM-11204
+ */
+ public static function setDomain($domainID) {
CRM_Core_Config::domainID($domainID);
self::getDomain($domainID);
CRM_Core_Config::singleton(TRUE, TRUE);
* @deprecated
* @see CRM_Core_BAO_Domain::setDomain
*/
- static function resetDomain() {
- CRM_Core_Config::domainID(null, true);
- self::getDomain(null, true);
+ public static function resetDomain() {
+ CRM_Core_Config::domainID(NULL, TRUE);
+ self::getDomain(NULL, TRUE);
CRM_Core_Config::singleton(TRUE, TRUE);
}
*
* @return null|string
*/
- static function version($skipUsingCache = false) {
+ public static function version($skipUsingCache = FALSE) {
return CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Domain',
CRM_Core_Config::domainID(),
'version',
* @param NULL
*
* @return array Location::getValues
- * @access public
*/
- function &getLocationValues() {
+ public function &getLocationValues() {
if ($this->_location == NULL) {
- $domain = self::getDomain(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);
* Save the values of a domain
*
* @param array $params
- * @param $id
+ * @param int $id
*
* @return array domain
- * @access public
*/
- static function edit(&$params, &$id) {
+ public static function edit(&$params, &$id) {
$domain = new CRM_Core_DAO_Domain();
$domain->id = $id;
$domain->copyValues($params);
* @param array $params
*
* @return array domain
- * @access public
*/
- static function create($params) {
+ public static function create($params) {
$domain = new CRM_Core_DAO_Domain();
$domain->copyValues($params);
$domain->save();
/**
* @return bool
*/
- static function multipleDomains() {
+ public static function multipleDomains() {
$session = CRM_Core_Session::singleton();
$numberDomains = $session->get('numberDomains');
* @return array name & email for domain
* @throws Exception
*/
- static function getNameAndEmail($skipFatal = FALSE) {
+ 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) {
}
/**
- * @param $contactID
+ * @param int $contactID
*
* @return bool|null|object|string
*/
- static function addContactToDomainGroup($contactID) {
+ public static function addContactToDomainGroup($contactID) {
$groupID = self::getGroupId();
if ($groupID) {
/**
* @return bool|null|object|string
*/
- static function getGroupId() {
+ public static function getGroupId() {
static $groupID = NULL;
if ($groupID) {
CRM_Core_Config::domainID(), 'name'
);
$groupID = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Group',
- $title, 'id', 'title', true
+ $title, 'id', 'title', TRUE
);
if (empty($groupID) && !empty($title)) {
$groupParams = array(
}
/**
- * @param $groupId
+ * @param int $groupId
*
* @return bool
*/
- static function isDomainGroup($groupId) {
+ public static function isDomainGroup($groupId) {
$domainGroupID = self::getGroupId();
return $domainGroupID == $groupId ? TRUE : FALSE;
}
/**
* @return array
*/
- static function getChildGroupIds() {
+ public static function getChildGroupIds() {
$domainGroupID = self::getGroupId();
$childGrps = array();
}
/**
- * retrieve a list of contact-ids that belongs to current domain/site.
+ * Retrieve a list of contact-ids that belongs to current domain/site.
*
* @return array
*/
- static function getContactList() {
+ public static function getContactList() {
$siteGroups = CRM_Core_BAO_Domain::getChildGroupIds();
$siteContacts = array();
return $siteContacts;
}
}
-