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


PHP R::findLast方法代码示例

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


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

示例1: iroha

 protected function iroha(array $arguments)
 {
     parent::RedBeanConnect('xandrosmaker_cba_pl');
     $relese = R::findLast('relki', 'where `seria` LIKE ? AND  `ep` = ?', ['%Iroha%', (int) $arguments[0]]);
     $message = $relese ? 'Prosze: ' . $relese->link : 'Jeszcze jej nie mam, ale lap w zamian ladny ending: http://exsubs.anidb.pl/?wpfb_dl=28';
     $this->message($message, $this->bot->getUserNick(), IRC::NOTICE);
     R::close();
 }
开发者ID:xandros15,项目名称:Saya-Bot,代码行数:8,代码来源:Fun.php

示例2: getLast

 function getLast($clientid)
 {
     $menu = R::findLast('menu', "client_id = ?", array($clientid));
     return $menu->export();
 }
开发者ID:spoooner12345,项目名称:arqui-backend,代码行数:5,代码来源:menu_model.php

示例3: testFinding

 /**
  * Begin testing.
  * This method runs the actual test pack.
  * 
  * @return void
  */
 public function testFinding()
 {
     $toolbox = R::$toolbox;
     $adapter = $toolbox->getDatabaseAdapter();
     $writer = $toolbox->getWriter();
     $redbean = $toolbox->getRedBean();
     $pdo = $adapter->getDatabase();
     $a = new RedBean_AssociationManager($toolbox);
     $page = $redbean->dispense("page");
     $page->name = "John's page";
     $idpage = $redbean->store($page);
     $page2 = $redbean->dispense("page");
     $page2->name = "John's second page";
     $idpage2 = $redbean->store($page2);
     $a->associate($page, $page2);
     $pageOne = $redbean->dispense("page");
     $pageOne->name = "one";
     $pageMore = $redbean->dispense("page");
     $pageMore->name = "more";
     $pageEvenMore = $redbean->dispense("page");
     $pageEvenMore->name = "evenmore";
     $pageOther = $redbean->dispense("page");
     $pageOther->name = "othermore";
     set1toNAssoc($a, $pageOther, $pageMore);
     set1toNAssoc($a, $pageOne, $pageMore);
     set1toNAssoc($a, $pageOne, $pageEvenMore);
     asrt(count($redbean->find("page", array(), " name LIKE '%more%' ", array())), 3);
     asrt(count($redbean->find("page", array(), " name LIKE :str ", array(":str" => '%more%'))), 3);
     asrt(count($redbean->find("page", array(), array(" name LIKE :str ", array(":str" => '%more%')))), 3);
     asrt(count($redbean->find("page", array(), " name LIKE :str ", array(":str" => '%mxore%'))), 0);
     asrt(count($redbean->find("page", array("id" => array(2, 3)))), 2);
     $bean = $redbean->dispense("wine");
     $bean->name = "bla";
     for ($i = 0; $i < 10; $i++) {
         $redbean->store($bean);
     }
     $redbean->find("wine", array("id" => 5));
     //  Finder:where call RedBean_OODB::convertToBeans
     $bean2 = $redbean->load("anotherbean", 5);
     asrt($bean2->id, 0);
     $keys = $adapter->getCol("SELECT id FROM page WHERE " . $writer->esc('name') . " LIKE '%John%'");
     asrt(count($keys), 2);
     $pages = $redbean->batch("page", $keys);
     asrt(count($pages), 2);
     $p = R::findLast('page');
     pass();
     $row = R::getRow('select * from page ');
     asrt(is_array($row), TRUE);
     asrt(isset($row['name']), TRUE);
     // Test findAll -- should not throw an exception
     asrt(count(R::findAll('page')) > 0, TRUE);
     asrt(count(R::findAll('page', ' ORDER BY id ')) > 0, TRUE);
     $beans = R::findOrDispense("page");
     asrt(count($beans), 6);
     asrt(is_null(R::findLast('nothing')), TRUE);
     try {
         R::find('bean', ' id > 0 ', 'invalid bindings argument');
         fail();
     } catch (RedBean_Exception_Security $exception) {
         pass();
     }
 }
开发者ID:daviddeutsch,项目名称:redbean-adaptive,代码行数:68,代码来源:Finding.php


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