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


PHP BookQuery::filterByTitle方法代碼示例

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


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

示例1: testSubQueryWithoutAliasRecursive

 public function testSubQueryWithoutAliasRecursive()
 {
     $c1 = new BookQuery();
     $c2 = new BookQuery();
     $c2->addSelectQuery($c1);
     // no alias
     $c2->filterByPrice(20, Criteria::LESS_THAN);
     $c3 = new BookQuery();
     $c3->addSelectQuery($c2);
     // no alias
     $c3->filterByTitle('War%');
     $sql = "SELECT alias_2.ID, alias_2.TITLE, alias_2.ISBN, alias_2.PRICE, alias_2.PUBLISHER_ID, alias_2.AUTHOR_ID FROM (SELECT alias_1.ID, alias_1.TITLE, alias_1.ISBN, alias_1.PRICE, alias_1.PUBLISHER_ID, alias_1.AUTHOR_ID FROM (SELECT book.ID, book.TITLE, book.ISBN, book.PRICE, book.PUBLISHER_ID, book.AUTHOR_ID FROM `book`) AS alias_1 WHERE alias_1.PRICE<:p2) AS alias_2 WHERE alias_2.TITLE LIKE :p1";
     $params = array(array('table' => 'book', 'column' => 'TITLE', 'value' => 'War%'), array('table' => 'book', 'column' => 'PRICE', 'value' => 20));
     $this->assertCriteriaTranslation($c3, $sql, $params, 'addSelectQuery() forges a unique alias if none is given');
 }
開發者ID:RafalFilipek,項目名稱:Propel2,代碼行數:15,代碼來源:SubQueryTest.php

示例2: testSubQueryWithoutAliasRecursive

 public function testSubQueryWithoutAliasRecursive()
 {
     $c1 = new BookQuery();
     $c2 = new BookQuery();
     $c2->addSelectQuery($c1);
     // no alias
     $c2->filterByPrice(20, Criteria::LESS_THAN);
     $c3 = new BookQuery();
     $c3->addSelectQuery($c2);
     // no alias
     $c3->filterByTitle('War%');
     $sql = $this->getSql("SELECT alias_2.id, alias_2.title, alias_2.isbn, alias_2.price, alias_2.publisher_id, alias_2.author_id FROM (SELECT alias_1.id, alias_1.title, alias_1.isbn, alias_1.price, alias_1.publisher_id, alias_1.author_id FROM (SELECT book.id, book.title, book.isbn, book.price, book.publisher_id, book.author_id FROM book) AS alias_1 WHERE alias_1.price<:p2) AS alias_2 WHERE alias_2.title LIKE :p1");
     $params = array(array('table' => 'book', 'column' => 'title', 'value' => 'War%'), array('table' => 'book', 'column' => 'price', 'value' => 20));
     $this->assertCriteriaTranslation($c3, $sql, $params, 'addSelectQuery() forges a unique alias if none is given');
 }
開發者ID:KyleGoslan,項目名稱:Huge-Propel,代碼行數:15,代碼來源:SubQueryTest.php


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