X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=Civi.php;h=12b2119b45bc846ca7472b3ac6a518c5140532fb;hb=358b59a5aefdaad550f6a09b5a1b86d0ab8f2f01;hp=d535e1afbd066791c363f02131e3499ff65ce014;hpb=90cdaa0e0f6a93d54d9c2743bacd521b995c3f58;p=civicrm-core.git diff --git a/Civi.php b/Civi.php index d535e1afbd..12b2119b45 100644 --- a/Civi.php +++ b/Civi.php @@ -18,7 +18,7 @@ class Civi { /** * A central location for static variable storage. - * + * @var array * @code * `Civi::$statics[__CLASS__]['foo'] = 'bar'; * @endcode @@ -117,6 +117,22 @@ class Civi { return CRM_Core_Resources::singleton(); } + /** + * Obtain the contact's personal settings. + * + * @param NULL|int $contactID + * For the default/active user's contact, leave $domainID as NULL. + * @param NULL|int $domainID + * For the default domain, leave $domainID as NULL. + * @return \Civi\Core\SettingsBag + * @throws CRM_Core_Exception + * If there is no contact, then there's no SettingsBag, and we'll throw + * an exception. + */ + public static function contactSettings($contactID = NULL, $domainID = NULL) { + return \Civi\Core\Container::getBootService('settings_manager')->getBagByContact($domainID, $contactID); + } + /** * Obtain the domain settings. *