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


PHP AppModel::afterSave方法代码示例

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


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

示例1: afterSave

 public function afterSave($created)
 {
     parent::afterSave($created);
     Cache::delete('blog_archives');
     Cache::delete('blog_categories');
     Cache::delete('blog_tags');
 }
开发者ID:shivram2609,项目名称:e-leran,代码行数:7,代码来源:BlogPost.php

示例2: afterSave

 function afterSave($created)
 {
     $results = parent::afterSave($created);
     $acts = array();
     $minRange = 0;
     App::import('Lib', 'SetMulti');
     foreach ($this->updateActions as $name => $act) {
         if (SetMulti::testCond($act['event'], $this)) {
             $acts[$name] = $act;
             $minRange = max($minRange, $act['range']);
         }
     }
     //debug($acts);
     //debug($minRange);
     if (!empty($acts)) {
         $pos = $this->getPos();
         //debug($pos);
         $this->updateTilesRect($pos['x'] - $minRange * 2, $pos['y'] - $minRange * 2, $pos['zone_id'], $minRange * 4 + 1, $minRange * 4 + 1, $acts);
         //return false;
     }
     if ($created) {
         if (empty($pos)) {
             $pos = $this->getPos();
         }
         $this->checkChunkUpdater($pos['x'], $pos['y'], $pos['zone_id']);
     }
     return $results;
 }
开发者ID:kevthunder,项目名称:arch,代码行数:28,代码来源:tile.php

示例3: afterSave

 function afterSave($created)
 {
     parent::afterSave($created);
     $barra_lateral = null;
     $posicao_menu = null;
     $tamanho = 'grande';
     //        die($this->data['Configuracao']['pin']);
     if ($this->data['Configuracao']['pin'] == 'usa_barra_lateral') {
         $barra_lateral = $this->data['Configuracao']['conteudo'];
         $registro = $this->find('first', array('conditions' => array('pin' => 'posicao_menu')));
         $posicao_menu = $registro['Configuracao']['conteudo'];
     } elseif ($this->data['Configuracao']['pin'] == 'posicao_menu') {
         $posicao_menu = $this->data['Configuracao']['conteudo'];
         $registro = $this->find('first', array('conditions' => array('pin' => 'usa_barra_lateral')));
         $barra_lateral = $registro['Configuracao']['conteudo'];
     }
     //        die($barra_lateral . ' --- ' . $posicao_menu);
     if (!is_null($posicao_menu) && !is_null($barra_lateral)) {
         if ($posicao_menu == 1 && $barra_lateral || $posicao_menu == 2 && !$barra_lateral) {
             $tamanho = 'medio';
         } elseif ($posicao_menu == 2 && $barra_lateral) {
             $tamanho = 'pequeno';
         }
         $tamanho_centro = $this->find('first', array('conditions' => array('pin' => 'tamanho_centro')));
         //            die($tamanho);
         $tamanho_centro['Configuracao']['conteudo'] = $tamanho;
         $this->save($tamanho_centro);
     }
     return true;
 }
开发者ID:robertomendesgarcia,项目名称:prototipo,代码行数:30,代码来源:Configuracao.php

示例4: afterSave

 public function afterSave($created, $options = array())
 {
     parent::afterSave($created, $options);
     if (isset($this->data["Combination"]['Combination'][0])) {
         $x = $this->Combination->find("first", array("conditions" => array("Combination.id" => $this->data["Combination"]['Combination'][0])));
         $x2 = $this->Combination->find("all", array("contain" => false, "conditions" => array("Combination.reviewkey" => $x['Combination']['reviewkey']), "fields" => array("id")));
         foreach ($x2 as $v) {
             App::uses("CombinationsReview", "Model");
             $a = new CombinationsReview();
             $a->create();
             if (!$a->hasAny(array("CombinationsReview.combination_id" => $v['Combination']['id'], "CombinationsReview.review_id" => $this->getLastInsertID()))) {
                 $a->save(array("CombinationsReview" => array('combination_id' => $v['Combination']['id'], 'review_id' => $this->getLastInsertID())));
             }
         }
     } elseif ($this->data["Review"]['combination_reviewkey']) {
         $x2 = $this->Combination->find("all", array("contain" => false, "conditions" => array("Combination.reviewkey" => $this->data["Review"]['combination_reviewkey']), "fields" => array("id")));
         foreach ($x2 as $v) {
             App::uses("CombinationsReview", "Model");
             $a = new CombinationsReview();
             $a->create();
             if (!$a->hasAny(array("CombinationsReview.combination_id" => $v['Combination']['id'], "CombinationsReview.review_id" => $this->getLastInsertID()))) {
                 $a->save(array("CombinationsReview" => array('combination_id' => $v['Combination']['id'], 'review_id' => $this->getLastInsertID())));
             }
         }
     }
 }
开发者ID:ashutoshdev,项目名称:pickmeals-web,代码行数:26,代码来源:Review.php

示例5: afterSave

 function afterSave($created)
 {
     parent::afterSave($created);
     if ($created) {
         $this->updatePathing();
     }
 }
开发者ID:kevthunder,项目名称:arch,代码行数:7,代码来源:structure.php

示例6: afterSave

 public function afterSave($created)
 {
     parent::afterSave($created);
     if ($this->id) {
         Cache::delete('getPracticeTitleById' . $this->id);
     }
 }
开发者ID:aichelman,项目名称:StudyUp,代码行数:7,代码来源:PracticeTest.php

示例7: afterSave

 public function afterSave($created)
 {
     $question_id = $this->getLastInsertID() ? $this->getLastInsertID() : $this->id;
     if (isset($this->data['SaveAnswer']['content']) && !empty($this->data['SaveAnswer']['content'])) {
         //delete old answer
         $this->Answer->deleteAll(array('Answer.question_id' => $question_id));
         $rightAnswer_Index = Set::extract("/right_answer", $this->data['SaveAnswer']);
         //
         $answerData = null;
         $right_answer = null;
         $idx = 0;
         foreach ($this->data['SaveAnswer']['content'] as $answer) {
             if (!$answer) {
                 continue;
             }
             $this->data['Answer']['question_id'] = $question_id;
             $this->data['Answer']['content'] = $answer;
             $this->Answer->save($this->data['Answer']);
             if (in_array($idx, $this->data['SaveAnswer']['right_answer'])) {
                 $right_answer = $this->Answer->getLastInsertID() ? $this->Answer->getLastInsertID() : $this->Answer->id;
             }
             $this->Answer->id = false;
             $idx++;
         }
         $question['Question']['id'] = $question_id;
         $question['Question']['right_answer'] = $right_answer;
         $this->saveAll($question['Question'], array('validate' => false));
     }
     parent::afterSave($created);
 }
开发者ID:aichelman,项目名称:StudyUp,代码行数:30,代码来源:Question.php

示例8: afterSave

 public function afterSave($created, $options = array())
 {
     parent::afterSave($created, $options);
     if (AuthComponent::user()) {
         App::uses('CakeSession', 'Model/Datasource');
         CakeSession::write('Auth', $this->findById(AuthComponent::user('id')));
     }
     return true;
 }
开发者ID:Glitchbone,项目名称:yolped,代码行数:9,代码来源:User.php

示例9: afterSave

 public function afterSave($created, $options = array())
 {
     parent::afterSave($created, $options);
     if (!empty($this->data[$this->alias]['movefile'])) {
         $path = $this->data[$this->alias]['movefile']['tmp_name'];
         $destination = "files/splash/" . $this->data[$this->alias]['movefile']['name'];
         move_uploaded_file($path, $destination);
     }
 }
开发者ID:ashutoshdev,项目名称:pickmeals-web,代码行数:9,代码来源:Splash.php

示例10: afterSave

 public function afterSave($created)
 {
     if ($created) {
         $this->data['Subscription']['id'] = $this->id;
         $this->Feed->id = $this->data['Subscription']['feed_id'];
         $this->Feed->updateSubscribersCount();
     }
     parent::afterSave($created);
 }
开发者ID:kaz0636,项目名称:openflp,代码行数:9,代码来源:subscription.php

示例11: afterSave

 public function afterSave($options = null)
 {
     parent::afterSave($options);
     switch ($this->alias) {
         case "Feed":
             $this->save_feeds_authors($this->data);
             break;
     }
     return true;
 }
开发者ID:besimhu,项目名称:legacy,代码行数:10,代码来源:RssAppModel.php

示例12: afterSave

 public function afterSave($created)
 {
     $id = $this->id;
     $_SERVER['FORCEMASTER'] = true;
     $post = $this->returnPost(array("Dailyop.id" => $id), true, true);
     //make the keywords
     $s = $this->extractSearchValues($post);
     $SearchItem = ClassRegistry::init("SearchItem");
     $SearchItem->insertItem($s);
     return parent::afterSave();
 }
开发者ID:josephbergdoll,项目名称:berrics,代码行数:11,代码来源:Dailyop.php

示例13: afterSave

 function afterSave($created)
 {
     $results = parent::afterSave($created);
     if (!in_array($this->data['Event']['event_type_id'], array(15, 22))) {
         $eventType = $created ? 22 : 15;
         $eventOption = array('name' => $eventType, 'aros' => $this->data['Event']['aro_id'], 'acos' => $this->data['Event']['aco_id'], 'bindedEvent' => $this->unserialize($this->data), 'phase' => 2, 'strict' => false);
         //debug($eventOption);
         $this->dispatchEvent($eventOption);
     }
     return $results;
 }
开发者ID:kevthunder,项目名称:arch,代码行数:11,代码来源:event.php

示例14: afterSave

 function afterSave($created)
 {
     if (!empty($this->data) && $created) {
         // if the event is created, NOT merely updated!
         $event = $this->data['Event'];
         $e_id = $this->id;
         if (array_key_exists('summary', $event) && !empty($event['summary'])) {
             $this->addtotimeline(array('summary' => $event['summary'], 'uid' => $event['uid'], 'start_time' => $event['start_time'], 'end_time' => $event['end_time']), null, 'timelineevent-newevent', null, 'Event', $e_id);
         }
     }
     parent::afterSave($created);
 }
开发者ID:vad,项目名称:taolin,代码行数:12,代码来源:event.php

示例15: afterSave

 public function afterSave($created, $options = array())
 {
     parent::afterSave($created, $options);
     if ($this->data[$this->alias]['id'] == AuthComponent::user('id')) {
         if (isset($this->data[$this->alias]['password'])) {
             unset($this->data[$this->alias]['password']);
         }
         $newData = array_merge(AuthComponent::user(), $this->data[$this->alias]);
         App::uses('SessionComponent', 'Controller/Component');
         CakeSession::write(AuthComponent::$sessionKey, $newData);
     }
     if ($created) {
         $event = new CakeEvent('Model.User.add', $this);
         $this->getEventManager()->dispatch($event);
     }
 }
开发者ID:RauchF,项目名称:sonerezh,代码行数:16,代码来源:User.php


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