本文整理汇总了PHP中REDCap::getDataDictionary方法的典型用法代码示例。如果您正苦于以下问题:PHP REDCap::getDataDictionary方法的具体用法?PHP REDCap::getDataDictionary怎么用?PHP REDCap::getDataDictionary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类REDCap
的用法示例。
在下文中一共展示了REDCap::getDataDictionary方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkReportStoreProjectConfig
public static function checkReportStoreProjectConfig()
{
$storePid = LR_REPORT_DATA_PROJECT_ID;
$sql = "select app_title, repeatforms from redcap_projects where project_id = {$storePid} ";
$q = db_query($sql);
// store project exists?
if ($q->num_rows === 0) {
return "Report store project id ({$storePid}) does not exist. Fix the setting in config.php.";
}
// not set to be longitudinal?
$row = db_fetch_assoc($q);
if ($row['repeatforms'] !== '0') {
return "Report store project ({$row['app_title']}) <strong>must not</strong> be longitudinal.";
}
// contains expected fields
$expectedFields = array('report_id', 'project_id', 'deleted', 'title', 'report_order', 'user_access', 'user_access_dags', 'user_access_roles', 'user_access_users', 'fields', 'output_dags', 'output_survey_fields', 'output_schedule_dates', 'output_survey_urls', 'limiter_fields', 'advanced_logic', 'filter_dags', 'orderby_field1', 'orderby_sort1', 'orderby_field2', 'orderby_sort2', 'orderby_field3', 'orderby_sort3', 'update_by', 'update_at');
$notFound = array();
$storeFields = REDCap::getDataDictionary($storePid, 'array');
foreach ($expectedFields as $f) {
if (!array_key_exists($f, $storeFields)) {
$notFound[] = $f;
}
}
if (count($notFound) > 0) {
return "Report store project ({$row['app_title']}) is missing the following expected fields: " . implode(', ', $notFound);
}
return true;
}