当前位置: 首页>>代码示例>>PHP>>正文


PHP Course::getDBConvert方法代码示例

本文整理汇总了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;
 }
开发者ID:sawh,项目名称:ostepu-system,代码行数:26,代码来源:Course.php

示例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;
 }
开发者ID:sawh,项目名称:ostepu-system,代码行数:28,代码来源:User.php

示例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;
 }
开发者ID:sawh,项目名称:ostepu-system,代码行数:23,代码来源:ExternalId.php


注:本文中的Course::getDBConvert方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。