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


PHP CakeTestModel::find方法代碼示例

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


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

示例1: find

 public function find($conditions = null, $fields = array(), $order = null, $recursive = null)
 {
     if ($this->throwException) {
         throw new Exception('Model tried to query database.');
     }
     return parent::find($conditions, $fields, $order, $recursive);
 }
開發者ID:kouno,項目名稱:EnumerableBehavior,代碼行數:7,代碼來源:enumerable_cache.test.php

示例2: find

 function find($command, $options = array())
 {
     if ($command == 'last') {
         $options = am(array('order' => 'id DESC'), $options);
         return parent::find('first', $options);
     } else {
         return parent::find($command, $options);
     }
 }
開發者ID:vuthaiphat,項目名稱:CakePHP-Assets,代碼行數:9,代碼來源:logable.test.php

示例3: find

 /**
  * find method
  *
  * @param mixed $type
  * @param array $options
  * @return void
  */
 public function find($conditions = null, $fields = array(), $order = null, $recursive = null)
 {
     if ($conditions === 'popular') {
         $conditions = array($this->name . '.' . $this->primaryKey . ' > ' => '1');
         $options = Hash::merge($fields, compact('conditions'));
         return parent::find('all', $options);
     }
     return parent::find($conditions, $fields);
 }
開發者ID:saihe,項目名稱:reservation,代碼行數:16,代碼來源:PaginatorComponentTest.php

示例4: testGetQueryLogs

 /**
  * ensure that getQueryLogs works and writes to the cache so the history panel will
  * work.
  *
  * @return void
  */
 public function testGetQueryLogs()
 {
     $model = new CakeTestModel(array('table' => 'posts', 'alias' => 'Post'));
     $model->find('all');
     $model->find('first');
     $result = $this->Toolbar->getQueryLogs($model->useDbConfig, array('cache' => false));
     $this->assertTrue(is_array($result));
     $this->assertTrue(count($result) >= 2, 'Should be more than 2 queries in the log %s');
     $this->assertTrue(isset($result['queries'][0]['actions']));
     $model->find('first');
     Cache::delete('debug_kit_toolbar_test_case', 'default');
     $result = $this->Toolbar->getQueryLogs($model->useDbConfig, array('cache' => true));
     $cached = $this->Toolbar->readCache('sql_log');
     $this->assertTrue(isset($cached[$model->useDbConfig]));
     $this->assertEquals($cached[$model->useDbConfig]['queries'][0], $result['queries'][0]);
 }
開發者ID:pritten,項目名稱:SmartCitizen.me,代碼行數:22,代碼來源:ToolbarHelperTest.php

示例5: find

 /**
  * find method
  *
  * @param mixed $type
  * @param array $options
  * @access public
  * @return void
  */
 function find($type, $options = array())
 {
     if ($type == 'popular') {
         $conditions = array($this->name . '.' . $this->primaryKey . ' > ' => '1');
         $options = Set::merge($options, compact('conditions'));
         return parent::find('all', $options);
     }
     return parent::find($type, $options);
 }
開發者ID:acerato,項目名稱:cntcetp,代碼行數:17,代碼來源:controller.test.php

示例6: testBlobSaving

 /**
  * test saving and retrieval of blobs
  *
  * @return void
  */
 public function testBlobSaving()
 {
     $this->loadFixtures('BinaryTest');
     $this->Dbo->cacheSources = false;
     $data = file_get_contents(CAKE . 'Test' . DS . 'test_app' . DS . 'webroot' . DS . 'img' . DS . 'cake.power.gif');
     $model = new CakeTestModel(array('name' => 'BinaryTest', 'ds' => 'test'));
     $model->save(compact('data'));
     $result = $model->find('first');
     $this->assertEquals($data, $result['BinaryTest']['data']);
 }
開發者ID:laiello,項目名稱:double-l-bookmanagement,代碼行數:15,代碼來源:MysqlTest.php

示例7: testBlobSaving

 /**
  * test saving and retrieval of blobs
  *
  * @return void
  */
 public function testBlobSaving()
 {
     $this->loadFixtures('BinaryTest');
     $this->Dbo->cacheSources = false;
     $data = "GIF87ab\n\t\tÒ4A¿¿¿ˇˇˇ,b\n\t\t¢îè©ÀÌ#¥⁄ã≥fi:¯Ü‚Héá¶jV∂ÓúÎL≥çÀóËıÎ…>ï≈ vFE%ÒâLFI<†µw˝±≈£7˘ç^H“≤«\f>Éâ*∑ÇnÖA•Ù|flêèj£:=ÿ6óUàµ5'∂®àA¬ñ∆ˆGE(gt’≈àÚyÁó«7\t‚VìöÇ√˙Ç™\n\t\tk”:;kÀAõ{*¡€Î˚˚[;;";
     $model = new CakeTestModel(array('name' => 'BinaryTest', 'ds' => 'test'));
     $model->save(compact('data'));
     $result = $model->find('first');
     $this->assertEqual($result['BinaryTest']['data'], $data);
 }
開發者ID:Nervie,項目名稱:Beta,代碼行數:15,代碼來源:MysqlTest.php


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