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


PHP Record::store方法代码示例

本文整理汇总了PHP中Record::store方法的典型用法代码示例。如果您正苦于以下问题:PHP Record::store方法的具体用法?PHP Record::store怎么用?PHP Record::store使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Record的用法示例。


在下文中一共展示了Record::store方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: updateJudgeStatus

 public function updateJudgeStatus()
 {
     try {
         $op = strtolower(trim(fRequest::get('status', 'string')));
         $judge_message = base64_decode(fRequest::get('judgeMessage', 'string'));
         $verdict = fRequest::get('verdict', 'integer');
         $id = fRequest::get('id', 'integer');
         $r = new Record($id);
         if ($op == 'running') {
             $r->setJudgeStatus(JudgeStatus::RUNNING);
             $r->setJudgeMessage($r->getJudgeMessage() . "\n{$judge_message}");
             $r->store();
         } else {
             if ($op == 'done') {
                 $r->setJudgeStatus(JudgeStatus::DONE);
                 if (!empty($judge_message)) {
                     $r->setJudgeMessage($judge_message);
                 }
                 $r->setVerdict($verdict);
                 $r->store();
             }
         }
         echo "{$op}\n";
         echo "{$judge_message}\n";
         echo "{$verdict}\n";
         echo "{$id}\n";
     } catch (fException $e) {
         echo -1;
     }
 }
开发者ID:daerduoCarey,项目名称:oj,代码行数:30,代码来源:PollingController.php

示例2: submit

 public function submit($problem_id)
 {
     try {
         $problem = new Problem($problem_id);
         $language = fRequest::get('language', 'integer');
         if (!array_key_exists($language, static::$languages)) {
             throw new fValidationException('Invalid language.');
         }
         fSession::set('last_language', $language);
         $code = trim(fRequest::get('code', 'string'));
         if (strlen($code) == 0) {
             throw new fValidationException('Code cannot be empty.');
         }
         if ($problem->isSecretNow()) {
             if (!User::can('view-any-problem')) {
                 throw new fAuthorizationException('Problem is secret now. You are not allowed to submit this problem.');
             }
         }
         $record = new Record();
         $record->setOwner(fAuthorization::getUserToken());
         $record->setProblemId($problem->getId());
         $record->setSubmitCode($code);
         $record->setCodeLanguage($language);
         $record->setSubmitDatetime(Util::currentTime());
         $record->setJudgeStatus(JudgeStatus::PENDING);
         $record->setJudgeMessage('Judging... PROB=' . $problem->getId() . ' LANG=' . static::$languages[$language]);
         $record->setVerdict(Verdict::UNKNOWN);
         $record->store();
         Util::redirect('/status');
     } catch (fException $e) {
         fMessaging::create('error', $e->getMessage());
         fMessaging::create('code', '/submit', fRequest::get('code', 'string'));
         Util::redirect("/submit?problem={$problem_id}");
     }
 }
开发者ID:daerduoCarey,项目名称:oj,代码行数:35,代码来源:SubmitController.php

示例3: store

 public function store()
 {
     global $g_pdo;
     if (($guest = Guest::get_from_email($this->get_value("email"))) != null) {
         $this->id = $guest->id;
     } else {
         parent::store();
     }
     $this->link_to_event();
 }
开发者ID:centaurustech,项目名称:truc,代码行数:10,代码来源:Guest.class.php

示例4: createRoot

 /**
  * createRoot
  *
  * @return  boolean
  */
 public function createRoot()
 {
     $record = new Record($this->table);
     $key = $this->getKeyName();
     $record->parent_id = 0;
     $record->lft = 0;
     $record->rgt = 1;
     $record->level = 0;
     $record->title = 'root';
     $record->alias = 'root';
     $record->access = 1;
     static::$rootId = $record->{$key};
     return $record->store();
 }
开发者ID:im286er,项目名称:windwalker,代码行数:19,代码来源:NestedRecord.php

示例5: manjudge

 public function manjudge($id, $score)
 {
     try {
         if (!User::can('rejudge-record')) {
             throw new fAuthorizationException('You are not allowed to rejudge records.');
         }
         if ($score < 0) {
             throw new fValidationException('Score cannot be negative.');
         }
         $record = new Record($id);
         $record->manjudge($score);
         $record->store();
         fMessaging::create('success', "Record {$id} manually judged.");
     } catch (fException $e) {
         fMessaging::create('error', $e->getMessage());
     }
     fURL::redirect(Util::getReferer());
 }
开发者ID:daerduoCarey,项目名称:oj,代码行数:18,代码来源:DashboardController.php


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