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


PHP Condition::create方法代碼示例

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


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

示例1: _argToCondition

 protected function _argToCondition($arg)
 {
     if (!$arg instanceof Condition) {
         $arg = Condition::create($arg);
         if ($this->_prefix) {
             $arg->setPrefix($this->_prefix);
         }
     }
     return $arg;
 }
開發者ID:Ekhvalov,項目名稱:recordsman,代碼行數:10,代碼來源:Condition.php

示例2: createSelectParams

 public static function createSelectParams($condition = null, $order = null, $limit = null)
 {
     $sql = "";
     if (!is_null($condition)) {
         $sql .= " WHERE " . Condition::create($condition)->toSql();
     } else {
         $sql .= " WHERE 1";
     }
     if ($order) {
         $sql .= " ORDER BY " . Helper::orderToSql($order);
     }
     if ($limit) {
         $sql .= " LIMIT " . Helper::limitToSql($limit);
     }
     return $sql;
 }
開發者ID:Ekhvalov,項目名稱:recordsman,代碼行數:16,代碼來源:Helper.php

示例3: _select

 public static function _select($condition = null, $order = null, $limit = null)
 {
     if (is_null(self::$_preloaded)) {
         self::$_preloaded = parent::_select();
     }
     //TODO: $order & $limit processing
     if (is_null($condition)) {
         return self::$_preloaded;
     }
     $condition = Condition::create($condition);
     $resultSet = [];
     foreach (self::$_preloaded as $entry) {
         if ($condition->test($entry)) {
             $resultSet[] = $entry;
         }
     }
     return $resultSet;
 }
開發者ID:Ekhvalov,項目名稱:recordsman,代碼行數:18,代碼來源:TPreload.php

示例4: testOrAndOrCondition

 public function testOrAndOrCondition()
 {
     $st = MODEL("SchemaTest");
     $or1 = new Sabel_Db_Condition_Or();
     $or1->add(Condition::create(EQUAL, "sint", 100));
     $or1->add(Condition::create(EQUAL, "sint", 300));
     $or2 = new Sabel_Db_Condition_Or();
     $or2->add(Condition::create(EQUAL, "sint", 300));
     $or2->add(Condition::create(EQUAL, "sint", 500));
     $st->setOrderBy("id");
     $st->setCondition($or1);
     $st->setCondition($or2);
     $results = $st->select();
     $this->assertEquals(2, count($results));
     $this->assertEquals("test5@example.com", $results[0]->email);
     $this->assertEquals("test6@example.com", $results[1]->email);
 }
開發者ID:reoring,項目名稱:sabel,代碼行數:17,代碼來源:Test.php

示例5: isMatch

 /**
  * @param $condition
  * @return bool
  */
 public function isMatch($condition)
 {
     return Condition::create($condition)->test($this->_fields);
 }
開發者ID:Ekhvalov,項目名稱:recordsman,代碼行數:8,代碼來源:Record.php


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