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


PHP OverallFavorite::create方法代碼示例

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


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

示例1: testCacheClearOnSave

 /**
  * test that Caches are getting cleared on save().
  * ensure that both inflections of controller names are getting cleared
  * as url for controller could be either overallFavorites/index or overall_favorites/index
  *
  * @return void
  */
 public function testCacheClearOnSave()
 {
     $_back = array('check' => Configure::read('Cache.check'), 'disable' => Configure::read('Cache.disable'));
     Configure::write('Cache.check', true);
     Configure::write('Cache.disable', false);
     $this->loadFixtures('OverallFavorite');
     $OverallFavorite = new OverallFavorite();
     touch(CACHE . 'views' . DS . 'some_dir_overallfavorites_index.php');
     touch(CACHE . 'views' . DS . 'some_dir_overall_favorites_index.php');
     $data = array('OverallFavorite' => array('id' => 22, 'model_type' => '8-track', 'model_id' => '3', 'priority' => '1'));
     $OverallFavorite->create($data);
     $OverallFavorite->save();
     $this->assertFalse(file_exists(CACHE . 'views' . DS . 'some_dir_overallfavorites_index.php'));
     $this->assertFalse(file_exists(CACHE . 'views' . DS . 'some_dir_overall_favorites_index.php'));
     Configure::write('Cache.check', $_back['check']);
     Configure::write('Cache.disable', $_back['disable']);
 }
開發者ID:manzapanza,項目名稱:cakephp-api-utils,代碼行數:24,代碼來源:ModelWriteTest.php


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