本文整理汇总了PHP中Course::getDBConvert方法的典型用法代码示例。如果您正苦于以下问题:PHP Course::getDBConvert方法的具体用法?PHP Course::getDBConvert怎么用?PHP Course::getDBConvert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Course
的用法示例。
在下文中一共展示了Course::getDBConvert方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ExtractCourse
public static function ExtractCourse($data, $singleResult = false, $CourseExtension = '', $SheetExtension = '', $isResult = true)
{
// generates an assoc array of courses by using a defined list of
// its attributes
$courses = DBJson::getObjectsByAttributes($data, Course::getDBPrimaryKey(), Course::getDBConvert(), $CourseExtension);
// generates an assoc array of settings by using a defined list of
// its attributes
$settings = DBJson::getObjectsByAttributes($data, Setting::getDBPrimaryKey(), Setting::getDBConvert());
// generates an assoc array of exercise sheets by using a defined list of
// its attributes
$exerciseSheets = DBJson::getObjectsByAttributes($data, ExerciseSheet::getDBPrimaryKey(), array(ExerciseSheet::getDBPrimaryKey() => ExerciseSheet::getDBConvert()[ExerciseSheet::getDBPrimaryKey()]), $SheetExtension);
// concatenates the courses and the associated settings
$res = DBJson::concatObjectListResult($data, $courses, Course::getDBPrimaryKey(), Course::getDBConvert()['C_settings'], $settings, Setting::getDBPrimaryKey());
// concatenates the courses and the associated exercise sheet IDs
$res = DBJson::concatResultObjectListAsArray($data, $res, Course::getDBPrimaryKey(), Course::getDBConvert()['C_exerciseSheets'], $exerciseSheets, ExerciseSheet::getDBPrimaryKey(), $SheetExtension, $CourseExtension);
if ($isResult) {
$res = Course::decodeCourse($res, false);
if ($singleResult == true) {
// only one object as result
if (count($res) > 0) {
$res = $res[0];
}
}
}
return $res;
}
示例2: ExtractCourseStatus
public static function ExtractCourseStatus($data, $singleResult = false, $UserExtension = '', $CourseStatusExtension = '', $CourseExtension = '', $isResult = true)
{
// generates an assoc array of a user by using a defined list of its
// attributes
$user = DBJson::getObjectsByAttributes($data, User::getDBPrimaryKey(), User::getDBConvert(), $UserExtension);
// generates an assoc array of course stats by using a defined list of
// its attributes
$courseStatus = DBJson::getObjectsByAttributes($data, CourseStatus::getDBPrimaryKey(), CourseStatus::getDBConvert(), $CourseStatusExtension);
// generates an assoc array of courses by using a defined list of
// its attributes
$courses = DBJson::getObjectsByAttributes($data, Course::getDBPrimaryKey(), Course::getDBConvert(), $CourseExtension);
// concatenates the course stats and the associated courses
$res = DBJson::concatObjectListsSingleResult($data, $courseStatus, CourseStatus::getDBPrimaryKey(), CourseStatus::getDBConvert()['CS_course'], $courses, Course::getDBPrimaryKey(), $CourseExtension, $CourseStatusExtension);
// concatenates the users and the associated course stats
$res = DBJson::concatResultObjectLists($data, $user, User::getDBPrimaryKey(), User::getDBConvert()['U_courses'], $res, CourseStatus::getDBPrimaryKey(), $CourseStatusExtension, $UserExtension);
if ($isResult) {
// to reindex
// $res = array_merge($res);
$res = CourseStatus::decodeCourseStatus($res, false);
if ($singleResult == true) {
// only one object as result
if (count($res) > 0) {
$res = $res[0];
}
}
}
return $res;
}
示例3: ExtractExternalId
public static function ExtractExternalId($data, $singleResult = false, $CourseExtension = '', $ExternalIdExtension = '', $isResult = true)
{
// generates an assoc array of courses by using a defined list of
// its attributes
$course = DBJson::getObjectsByAttributes($data, Course::getDBPrimaryKey(), Course::getDBConvert(), $CourseExtension);
// generates an assoc array of external IDs by using a defined list of
// its attributes
$externalIds = DBJson::getObjectsByAttributes($data, ExternalId::getDBPrimaryKey(), ExternalId::getDBConvert(), $ExternalIdExtension);
// concatenates the external IDs and the associated courses
$res = DBJson::concatObjectListsSingleResult($data, $externalIds, ExternalId::getDBPrimaryKey(), ExternalId::getDBConvert()['EX_course'], $course, Course::getDBPrimaryKey(), $CourseExtension, $ExternalIdExtension);
if ($isResult) {
// to reindex
$res = array_values($res);
$res = ExternalId::decodeExternalId($res, false);
if ($singleResult == true) {
// only one object as result
if (count($res) > 0) {
$res = $res[0];
}
}
}
return $res;
}