Beispiel #1
0
 public static function fromArray($array, $prefix = '')
 {
     $item = new MilestoneStatusRule();
     DataMappers::fromArray($item, $array, $prefix);
     if (is_string($item->milestoneMap)) {
         $item->milestoneMap = explode(',', $item->milestoneMap);
     }
     return $item;
 }
Beispiel #2
0
 public static function fetchResult(Connection $conn, Area $area, Course $course)
 {
     $data = $conn->fetchAssoc('SELECT r.* ' . 'FROM `' . CourseTables::COURSE_RESULT_TBL . '` r ' . 'INNER JOIN `' . CourseTables::COURSE_AREA_RESULT_TBL . '` a ON a.`courseId` = r.`courseId` AND a.`userId` = r.`userId` ' . 'WHERE a.`areaId` = :areaId AND a.`courseId` = :courseId', array(':areaId' => $area->getId(), ':courseId' => $course->getId()));
     $result = new AreaCourseResult();
     $result->area = $area;
     $result->course = $course;
     $result->result = Question::RESULT_UNKNOWN;
     if (false === $data) {
         return $result;
     }
     DataMappers::fromArray($result, $data);
     return $result;
 }
Beispiel #3
0
 public static function fetchResult(Connection $conn, User $user, Course $course)
 {
     $data = $conn->fetchAssoc('SELECT * FROM `' . CourseTables::COURSE_RESULT_TBL . '` WHERE `userId` = :userId AND `courseId` = :courseId', array(':userId' => $user->getId(), ':courseId' => $course->getId()));
     $result = new TestResult();
     $result->user = $user;
     $result->course = $course;
     $result->result = Question::RESULT_UNKNOWN;
     if (false === $data) {
         return $result;
     }
     DataMappers::fromArray($result, $data);
     return $result;
 }
Beispiel #4
0
 public static function fromArray($array, $prefix = '')
 {
     $item = new GroupCategory();
     DataMappers::fromArray($item, $array, $prefix);
     return $item;
 }
Beispiel #5
0
 public static function fromArray($array, $prefix = '')
 {
     $user = new User();
     DataMappers::fromArray($user, $array, $prefix);
     if (isset($array['language_id'])) {
         $user->settingsLanguage = Language::fromArray($array, 'language');
     }
     if ($user->getAdmin()) {
         $user->addRole('ROLE_ADMIN');
     }
     return $user;
 }
Beispiel #6
0
 public static function fromArray($array, $prefix = '')
 {
     $item = new AppMail();
     DataMappers::fromArray($item, $array, $prefix);
     return $item;
 }
Beispiel #7
0
 public static function fromArray($array, $prefix = '')
 {
     $item = new MilestoneRule();
     DataMappers::fromArray($item, $array, $prefix);
     return $item;
 }
Beispiel #8
0
 public static function fromArray($array, $prefix = '')
 {
     $item = new Area();
     if (!empty($array['customData'])) {
         $item->customData = json_decode($array['customData'], true);
         unset($array['customData']);
     } else {
         $item->customData = [];
         unset($array['customData']);
     }
     DataMappers::fromArray($item, $array, $prefix);
     return $item;
 }
Beispiel #9
0
 public static function fromArray($array, $prefix = '')
 {
     $item = new EdkParticipant();
     DataMappers::fromArray($item, $array, $prefix);
     return $item;
 }
Beispiel #10
0
 public static function fromArray($array, $prefix = '')
 {
     $item = new UserRegistration();
     DataMappers::fromArray($item, $array, $prefix);
     return $item;
 }
Beispiel #11
0
 public function __construct(ForumRoot $root, ForumParentInterface $parent, array $data)
 {
     DataMappers::fromArray($this, $data);
     $this->setParent($parent);
 }
Beispiel #12
0
 public static function fromArray($array, $prefix = '')
 {
     $item = new Project();
     DataMappers::fromArray($item, $array, $prefix);
     if (is_string($item->modules)) {
         if ($item->modules === '') {
             $item->modules = [];
         } else {
             $item->modules = explode(',', $item->modules);
         }
     }
     return $item;
 }