当前位置: 首页>>代码示例>>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;未经允许,请勿转载。