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


PHP CBaseActiveRelation类代码示例

本文整理汇总了PHP中CBaseActiveRelation的典型用法代码示例。如果您正苦于以下问题:PHP CBaseActiveRelation类的具体用法?PHP CBaseActiveRelation怎么用?PHP CBaseActiveRelation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: mergeWith

 public function mergeWith($criteria, $fromScope = false)
 {
     if ($criteria instanceof CDbCriteria) {
         $criteria = $criteria->toArray();
     }
     if ($fromScope) {
         if (isset($criteria['condition']) && $this->on !== $criteria['condition']) {
             if ($this->on === '') {
                 $this->on = $criteria['condition'];
             } elseif ($criteria['condition'] !== '') {
                 $this->on = "({$this->on}) AND ({$criteria['condition']})";
             }
         }
         unset($criteria['condition']);
     }
     parent::mergeWith($criteria);
     if (isset($criteria['joinType'])) {
         $this->joinType = $criteria['joinType'];
     }
     if (isset($criteria['on']) && $this->on !== $criteria['on']) {
         if ($this->on === '') {
             $this->on = $criteria['on'];
         } elseif ($criteria['on'] !== '') {
             $this->on = "({$this->on}) AND ({$criteria['on']})";
         }
     }
     if (isset($criteria['with'])) {
         $this->with = $criteria['with'];
     }
     if (isset($criteria['alias'])) {
         $this->alias = $criteria['alias'];
     }
     if (isset($criteria['together'])) {
         $this->together = $criteria['together'];
     }
 }
开发者ID:smokeelow,项目名称:faicore,代码行数:36,代码来源:yiilite.php

示例2: mergeWith

 /**
  * Merges this relation with a criteria specified dynamically.
  * @param array the dynamically specified criteria
  * @since 1.0.5
  */
 public function mergeWith($criteria)
 {
     parent::mergeWith($criteria);
     if (isset($criteria['joinType'])) {
         $this->joinType = $criteria['joinType'];
     }
     if (isset($criteria['on']) && $this->on !== $criteria['on']) {
         if ($this->on === '') {
             $this->on = $criteria['on'];
         } else {
             if ($criteria['on'] !== '') {
                 $this->on = "({$this->on}) AND ({$criteria['on']})";
             }
         }
     }
     if (isset($criteria['with'])) {
         $this->with = $criteria['with'];
     }
     if (isset($criteria['alias'])) {
         $this->alias = $criteria['alias'];
     }
     if (isset($criteria['together'])) {
         $this->together = $criteria['together'];
     }
 }
开发者ID:kdambekalns,项目名称:framework-benchs,代码行数:30,代码来源:CActiveRecord.php


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