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


PHP ActiveQuery::where方法代碼示例

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


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

示例1: getActiveToken

 public static function getActiveToken($token)
 {
     $activeQuery = new ActiveQuery(self::className());
     $activeQuery->where('access_token = :token', [':token' => $token]);
     $activeQuery->andWhere('expires > now()');
     $token = $activeQuery->one();
     return $token;
 }
開發者ID:portalsway2,項目名稱:APEDevices,代碼行數:8,代碼來源:OauthAccessTokens.php

示例2: activeByNameDecoded

 /**
  * @inheritdoc
  * @return Parametro|array|null
  */
 public function activeByNameDecoded($name, $db = null)
 {
     $ret = parent::where(['nombre' => $name])->andWhere('fecha_fin is null')->one();
     if (!$ret) {
         return null;
     }
     return Json::decode($ret->valor);
 }
開發者ID:fernandrez,項目名稱:ipcbsas,代碼行數:12,代碼來源:ParametroQuery.php

示例3: catering

 /**
  * Set catering parameters.
  *
  * @param null $db
  * @param array $values
  */
 public function catering($db = null, $values)
 {
     /** @var Settings $row */
     $row = parent::where(['key' => 'catering'])->one($db);
     $newValue = json_encode($values);
     if (false === $newValue) {
         Yii::error(__METHOD__ . '=> `json_encode` failed!');
         return;
     }
     $this->createOrUpdateSettings($row, 'catering', $newValue);
 }
開發者ID:nthrnth,項目名稱:catering-terminal,代碼行數:17,代碼來源:SettingsSetterQuery.php

示例4: findProfile

 /**
  * Finds a profile.
  *
  * @param mixed $condition
  *
  * @return \yii\db\ActiveQuery
  */
 public function findProfile($condition)
 {
     return $this->profileQuery->where($condition);
 }
開發者ID:TheManagers,項目名稱:yii2-user,代碼行數:11,代碼來源:Finder.php

示例5: catering

 /**
  * Get catering settings as array.
  *
  * @param null $db
  * @return array|null
  */
 public function catering($db = null)
 {
     /** @var Settings $row   */
     $row = parent::where(['key' => 'catering'])->one($db);
     return is_null($row) ? ['host' => '', 'bank_id' => '', 'password' => '', 'use_account_type' => false] : json_decode($row->value, true);
 }
開發者ID:nthrnth,項目名稱:catering-terminal,代碼行數:12,代碼來源:SettingsGetterQuery.php

示例6: countProductsForOrder

 public function countProductsForOrder($id)
 {
     return parent::where(['order_id' => $id])->count();
 }
開發者ID:kvaxminsk,項目名稱:belpharma2,代碼行數:4,代碼來源:OrderedProductQuery.php

示例7: findComment

 /**
  * Finds a category by the given condition.
  *
  * @param mixed $condition Condition to be used on search.
  *
  * @return \yii\db\ActiveQuery
  */
 public function findComment($condition)
 {
     return $this->commentQuery->where($condition);
 }
開發者ID:jarrus90,項目名稱:yii2-website-comments,代碼行數:11,代碼來源:WebsiteCommentsFinder.php

示例8: getTaskModel

 public static function getTaskModel($id)
 {
     if (!isset($id)) {
         return false;
     }
     $query = new ActiveQuery(new Task());
     return $query->where(['id' => $id])->one();
 }
開發者ID:cubiclab,項目名稱:project-cube,代碼行數:8,代碼來源:Project.php

示例9: getSubtasks

 public function getSubtasks()
 {
     $query = new ActiveQuery(new Task());
     return $query->where(['projectID' => $this->projectID, 'parenttask' => $this->id])->all();
 }
開發者ID:cubiclab,項目名稱:project-cube,代碼行數:5,代碼來源:Task.php

示例10: findNoteById

 public function findNoteById($id)
 {
     return $this->noteQuery->where(['id' => $id])->one();
 }
開發者ID:devbrom,項目名稱:yii2-releases,代碼行數:4,代碼來源:Finder.php

示例11: findUserType

 /**
  * Finds a user type.
  *
  * @param mixed $condition
  *
  * @return \yii\db\ActiveQuery
  */
 public function findUserType($condition)
 {
     return $this->userTypeQuery->where($condition);
 }
開發者ID:lnch,項目名稱:yii2-user-control,代碼行數:11,代碼來源:Finder.php

示例12: findPage

 /**
  * Finds a page by the given condition.
  *
  * @param mixed $condition Condition to be used on search.
  *
  * @return \yii\db\ActiveQuery
  */
 public function findPage($condition)
 {
     return $this->pageQuery->where($condition);
 }
開發者ID:jarrus90,項目名稱:yii2-support,代碼行數:11,代碼來源:SupportFinder.php

示例13: findBlock

 /**
  * Finds a page by the given condition.
  *
  * @param mixed $condition Condition to be used on search.
  *
  * @return \yii\db\ActiveQuery
  */
 public function findBlock($condition)
 {
     return $this->blockQuery->where($condition);
 }
開發者ID:jarrus90,項目名稱:yii2-content,代碼行數:11,代碼來源:ContentFinder.php


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