本文整理匯總了PHP中CRM_Logging_Schema::isEnabled方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Logging_Schema::isEnabled方法的具體用法?PHP CRM_Logging_Schema::isEnabled怎麽用?PHP CRM_Logging_Schema::isEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CRM_Logging_Schema
的用法示例。
在下文中一共展示了CRM_Logging_Schema::isEnabled方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: useLoggingReport
/**
* Function for find out whether to use logging schema entries for contact
* summary, instead of normal log entries.
*
* @return int report id of Contact Logging Report (Summary) / false
* @access public
* @static
*/
static function useLoggingReport()
{
// first check if logging is enabled
$config = CRM_Core_Config::singleton();
if (!$config->logging) {
return FALSE;
}
$loggingSchema = new CRM_Logging_Schema();
if ($loggingSchema->isEnabled()) {
$params = array('report_id' => 'logging/contact/summary');
$instance = array();
CRM_Report_BAO_ReportInstance::retrieve($params, $instance);
if (!empty($instance) && (empty($instance['permission']) || !empty($instance['permission']) && CRM_Core_Permission::check($instance['permission']))) {
return $instance['id'];
}
}
return FALSE;
}
示例2: assertLoggingEnabled
/**
* Assert logging is enabled or disabled as per input parameter.
*
* @param bool $expected
* Do we expect it to be enabled.
*/
protected function assertLoggingEnabled($expected)
{
$schema = new CRM_Logging_Schema();
$this->assertTrue($schema->isEnabled() === $expected);
}