Example #1
0
 /**
  * @param  $mapping
  * @return Status
  */
 public function wrap($mapping, $prefix = '')
 {
     $result = parent::wrap(array('submitId', 'taskId', 'userId', 'langId', 'timestamp', 'time', 'result', 'task', 'nickname', 'info', 'studyplace', 'city', 'division', 'tatarstan'), 'status', $mapping, $prefix);
     switch ($this->result) {
         case '0':
             $this->result = 'OK';
             break;
         case '255':
             $this->result = 'FL';
             break;
         case '21':
             $this->result = 'CE';
             break;
     }
     if ($this->result % 100 == 1) {
         $this->result = 'WA' . (int) ($this->result / 100);
     } elseif ($this->result % 100 == 2) {
         $this->result = 'PE' . (int) ($this->result / 100);
     } elseif ($this->result % 100 == 3) {
         $this->result = 'TL' . (int) ($this->result / 100);
     } elseif ($this->result % 100 == 4) {
         $this->result = 'RE' . (int) ($this->result / 100);
     } elseif ($this->result % 100 == 20) {
         $this->result = 'ML' . (int) ($this->result / 100);
     } elseif ($this->result % 100 == 23) {
         $this->result = 'DL' . (int) ($this->result / 100);
     }
     return $result;
 }
Example #2
0
 /**
  * @param  $mapping
  * @return Team
  */
 public function wrap($mapping)
 {
     $result = parent::wrap(array('id', 'name', 'education', 'city'), 'team', $mapping);
     $this->setContestantA(Butler::getORMManager()->createMember()->wrap($mapping, 'teamcontestanta'));
     $this->setContestantB(Butler::getORMManager()->createMember()->wrap($mapping, 'teamcontestantb'));
     $this->setContestantC(Butler::getORMManager()->createMember()->wrap($mapping, 'teamcontestantc'));
     $this->setHead(Butler::getORMManager()->createMember()->wrap($mapping, 'teamhead'));
     $this->setCoach(Butler::getORMManager()->createMember()->wrap($mapping, 'teamcoach'));
     return $result;
 }
Example #3
0
 /**
  * @param  $mapping
  * @return Member
  */
 public function wrap($mapping, $prefix = '')
 {
     $result = parent::wrap(array('id', 'name', 'role', 'teamid'), 'member', $mapping, $prefix);
     $this->user = Butler::getORMManager()->createUser()->wrap($mapping, $prefix . 'member');
     return $result;
 }
Example #4
0
 /**
  * @param  $mapping
  * @return User
  */
 public function wrap($mapping, $prefix = '')
 {
     $result = parent::wrap(array('id', 'letter', 'publishedAfter'), 'problem', $mapping, $prefix);
     return $result;
 }
 /**
  * @param  $mapping
  * @return PersonalInfo
  */
 public function wrap($mapping, $prefix = '')
 {
     $result = parent::wrap(array('id', 'userId', 'surname', 'name', 'patrName', 'birthDate', 'passportNo', 'passportDate', 'passportIssue', 'PTPN', 'phone', 'region', 'city', 'postIndex', 'address'), 'persinfo', $mapping, $prefix);
     return $result;
 }
Example #6
0
 /**
  * @param  $mapping
  * @return User
  */
 public function wrap($mapping, $prefix = '')
 {
     $result = parent::wrap(array('id', 'nickname', 'info', 'city', 'studyplace', 'division', 'tatarstan'), 'user', $mapping, $prefix);
     $this->personalInfo = Butler::getORMManager()->createPersonalInfo()->wrap($mapping, $prefix . 'user');
     return $result;
 }