當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Rank::save方法代碼示例

本文整理匯總了PHP中Rank::save方法的典型用法代碼示例。如果您正苦於以下問題:PHP Rank::save方法的具體用法?PHP Rank::save怎麽用?PHP Rank::save使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Rank的用法示例。


在下文中一共展示了Rank::save方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: actionCreate

 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Rank();
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Rank'])) {
         $model->attributes = $_POST['Rank'];
         if ($model->save()) {
             $this->redirect(array('view', 'id' => $model->id));
         }
     }
     $this->render('create', array('model' => $model));
 }
開發者ID:dieos2,項目名稱:bolao,代碼行數:17,代碼來源:RankController.php

示例2: saveRank

 private function saveRank($playerId, $tournamentId, $score, $oRank)
 {
     if ($oRank instanceof Doctrine_Record) {
         $oRank->score = $score;
         $oRank->save();
     } else {
         $rank = new Rank();
         $rank->Players_id = $playerId;
         $rank->Tournaments_id = $tournamentId;
         $rank->score = $score;
         $rank->save();
     }
 }
開發者ID:jager,項目名稱:cms,代碼行數:13,代碼來源:Rank.php

示例3: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     //
     try {
         $rank = new Rank();
         $rank->title = Input::get('title');
         $rank->link = Input::get('link');
         $rank->target = Input::get('target');
         $rank->sort = Rank::max('sort') + 1;
         $rank->save();
         return Redirect::route('admin.ranks.index');
     } catch (Exception $e) {
         return Redirect::back()->withInput()->withErrors('新增失敗');
     }
 }
開發者ID:kettanyam,項目名稱:20141001done,代碼行數:20,代碼來源:RanksController.php

示例4: actionUpdate

 /**
  * Updates a particular model.
  * If update is successful, the browser will be redirected to the 'view' page.
  * @param integer $id the ID of the model to be updated
  */
 public function actionUpdate($id)
 {
     $model = $this->loadModel($id);
     // Uncomment the following line if AJAX validation is needed
     // $this->performAjaxValidation($model);
     if (isset($_POST['Confronto'])) {
         $model->attributes = $_POST['Confronto'];
         if ($model->empate == 1) {
             $model->vencedor = null;
         }
         $Criteria = new CDbCriteria();
         $Criteria->condition = "id_confronto={$model->id}";
         $modelAposta = Aposta::model()->findAll($Criteria);
         foreach ($modelAposta as $item) {
             if ($item->placar_casa == $model->placar_casa && $item->placar_visitante == $model->placar_visitante) {
                 $modelRank = new Rank();
                 $modelRank->id_user = $item->id_user;
                 $modelRank->data = date('Y-m-d H:i:s');
                 $modelRank->id_aposta = $item->id;
                 if ($item->idConfronto->id_grupo == 10) {
                     $modelRank->id_ponto = 3;
                 } else {
                     if ($item->idConfronto->id_grupo == 11) {
                         $modelRank->id_ponto = 5;
                     } else {
                         if ($item->idConfronto->id_grupo == 12) {
                             $modelRank->id_ponto = 7;
                         } else {
                             if ($item->idConfronto->id_grupo == 13) {
                                 $modelRank->id_ponto = 9;
                             } else {
                                 if ($item->idConfronto->id_grupo == 9) {
                                     $modelRank->id_ponto = 9;
                                 } else {
                                     $modelRank->id_ponto = 1;
                                 }
                             }
                         }
                     }
                 }
                 $modelRank->save();
             } else {
                 if ($model->vencedor != null) {
                     if ($item->placar_casa > $item->placar_visitante && $model->vencedor == $model->id_time_casa) {
                         $modelRank = new Rank();
                         $modelRank->id_user = $item->id_user;
                         $modelRank->data = date('Y-m-d H:i:s');
                         $modelRank->id_aposta = $item->id;
                         if ($item->idConfronto->id_grupo == 10) {
                             $modelRank->id_ponto = 4;
                         } else {
                             if ($item->idConfronto->id_grupo == 11) {
                                 $modelRank->id_ponto = 6;
                             } else {
                                 if ($item->idConfronto->id_grupo == 12) {
                                     $modelRank->id_ponto = 8;
                                 } else {
                                     if ($item->idConfronto->id_grupo == 13) {
                                         $modelRank->id_ponto = 10;
                                     } else {
                                         if ($item->idConfronto->id_grupo == 9) {
                                             $modelRank->id_ponto = 10;
                                         } else {
                                             $modelRank->id_ponto = 2;
                                         }
                                     }
                                 }
                             }
                         }
                         $modelRank->save();
                     } else {
                         if ($item->placar_casa < $item->placar_visitante && $model->vencedor == $model->id_time_visitante) {
                             $modelRank = new Rank();
                             $modelRank->id_user = $item->id_user;
                             $modelRank->data = date('Y-m-d H:i:s');
                             $modelRank->id_aposta = $item->id;
                             if ($item->idConfronto->id_grupo == 10) {
                                 $modelRank->id_ponto = 4;
                             } else {
                                 if ($item->idConfronto->id_grupo == 11) {
                                     $modelRank->id_ponto = 6;
                                 } else {
                                     if ($item->idConfronto->id_grupo == 12) {
                                         $modelRank->id_ponto = 8;
                                     } else {
                                         if ($item->idConfronto->id_grupo == 13) {
                                             $modelRank->id_ponto = 10;
                                         } else {
                                             if ($item->idConfronto->id_grupo == 9) {
                                                 $modelRank->id_ponto = 10;
                                             } else {
                                                 $modelRank->id_ponto = 2;
                                             }
                                         }
                                     }
//.........這裏部分代碼省略.........
開發者ID:dieos2,項目名稱:bolao,代碼行數:101,代碼來源:ConfrontoController.php

示例5: Rank

 $rank->create();
 $section->create();
 $event->create();
 $client->create();
 $configuration->put('UPDATE_URL', 'http://update.idleman.fr/yana?callback=?');
 $configuration->put('DEFAULT_THEME', 'default');
 $configuration->put('COOKIE_NAME', 'yana');
 $configuration->put('COOKIE_LIFETIME', '7');
 $configuration->put('VOCAL_ENTITY_NAME', 'YANA');
 $configuration->put('PROGRAM_VERSION', '3.0.6');
 $configuration->put('HOME_PAGE', 'index.php');
 $configuration->put('VOCAL_SENSITIVITY', '0.0');
 //Création du rang admin
 $rank = new Rank();
 $rank->setLabel('admin');
 $rank->save();
 //Déclaration des sections du programme
 $sections = array('event', 'vocal', 'user', 'plugin', 'configuration', 'admin');
 //Création des sections déclarées et attribution de tous les droits sur toutes ces sections pour l'admin
 foreach ($sections as $sectionName) {
     $s = new Section();
     $s->setLabel($sectionName);
     $s->save();
     $r = new Right();
     $r->setSection($s->getId());
     $r->setRead('1');
     $r->setDelete('1');
     $r->setCreate('1');
     $r->setUpdate('1');
     $r->setRank($rank->getId());
     $r->save();
開發者ID:thib3113,項目名稱:yana-server,代碼行數:31,代碼來源:install.php


注:本文中的Rank::save方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。