PHP User::getDBConvert Examples

PHP User::getDBConvert - 3 examples found. These are the top rated real world PHP examples of User::getDBConvert extracted from open source projects. You can rate examples to help us improve the quality of examples.
Example #1
0
 public static function ExtractInvitation($data, $singleResult = false, $LeaderExtension = '', $MemberExtension = '', $InvitationExtension = '', $isResult = true)
 {
     // generates an assoc array of users by using a defined list of
     // its attributes
     $leader = DBJson::getObjectsByAttributes($data, User::getDBPrimaryKey(), User::getDBConvert(), $LeaderExtension);
     // generates an assoc array of users by using a defined list of
     // its attributes
     $member = DBJson::getObjectsByAttributes($data, User::getDBPrimaryKey(), User::getDBConvert(), $MemberExtension . '2');
     // generates an assoc array of invitations by using a defined list of
     // its attributes
     $invitations = DBJson::getObjectsByAttributes($data, Invitation::getDBPrimaryKey(), Invitation::getDBConvert(), $InvitationExtension);
     // concatenates the invitations and the associated invitation leader
     $res = DBJson::concatObjectListsSingleResult($data, $invitations, Invitation::getDBPrimaryKey(), Invitation::getDBConvert()['U_leader'], $leader, User::getDBPrimaryKey(), $InvitationExtension, $LeaderExtension);
     // concatenates the invitations and the associated invitation member
     $res = DBJson::concatObjectListsSingleResult($data, $res, Invitation::getDBPrimaryKey(), Invitation::getDBConvert()['U_member'], $member, User::getDBPrimaryKey(), $MemberExtension . '2', $InvitationExtension);
     if ($isResult) {
         // to reindex
         $res = array_values($res);
         $res = Invitation::decodeInvitation($res, false);
         if ($singleResult == true) {
             // only one object as result
             if (count($res) > 0) {
                 $res = $res[0];
             }
         }
     }
     return $res;
 }
Example #2
0
 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;
 }
Example #3
0
 public static function ExtractGroup($data, $singleResult = false, $LeaderExtension = '', $MemberExtension = '', $GroupExtension = '', $isResult = true)
 {
     // generates an assoc array of an user by using a defined list of
     // its attributes
     $leader = DBJson::getObjectsByAttributes($data, User::getDBPrimaryKey(), User::getDBConvert(), $LeaderExtension);
     // generates an assoc array of users by using a defined list of
     // its attributes
     $member = DBJson::getObjectsByAttributes($data, User::getDBPrimaryKey(), User::getDBConvert(), $MemberExtension . '2');
     // generates an assoc array of groups by using a defined list of
     // its attributes
     $groups = DBJson::getObjectsByAttributes($data, Group::getDBPrimaryKey(), Group::getDBConvert(), $GroupExtension);
     // concatenates the groups and the associated group leader
     $res = DBJson::concatObjectListsSingleResult($data, $groups, Group::getDBPrimaryKey(), Group::getDBConvert()['U_leader'], $leader, User::getDBPrimaryKey(), $LeaderExtension, $GroupExtension);
     // concatenates the groups and the associated group member
     $res = DBJson::concatResultObjectLists($data, $res, Group::getDBPrimaryKey(), Group::getDBConvert()['U_member'], $member, User::getDBPrimaryKey(), $MemberExtension . '2', $GroupExtension);
     if ($isResult) {
         // to reindex
         $res = array_merge($res);
         $res = Group::decodeGroup($res, false);
         if ($singleResult == true) {
             // only one object as result
             if (count($res) > 0) {
                 $res = $res[0];
             }
         }
     }
     return $res;
 }