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


PHP CActiveRecord::beforeFind方法代码示例

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


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

示例1: beforeFind

 public function beforeFind()
 {
     if (is_subclass_of(Yii::app()->controller, 'BackController') && Yii::app()->languageManager->multilang) {
         $this->multilang();
     }
     return parent::beforeFind();
 }
开发者ID:kostya1017,项目名称:our,代码行数:7,代码来源:BlocDocumentDocument.php

示例2: beforeFind

 public function beforeFind()
 {
     if (parent::beforeFind()) {
         $this->username = strtolower($this->username);
         return true;
     }
     return false;
 }
开发者ID:jayrulez,项目名称:yiisns,代码行数:8,代码来源:User.php

示例3: beforeFind

 protected function beforeFind()
 {
     parent::beforeFind();
     if (isset(Yii::app()->user->latitude, Yii::app()->user->longitude)) {
         $this->attachBehaviors(array('NearScopeBehavior' => array('class' => 'ext.behavior.NearScopeBehavior', 'latitude' => Yii::app()->user->latitude, 'longitude' => Yii::app()->user->longitude, 'enableDistance' => true)));
         $this->near();
         //CTimeBehavior实现了自动调用。人家用的是事件。我们没有用事件,只能是手工调用了
     }
     return true;
 }
开发者ID:tiger2soft,项目名称:travelman,代码行数:10,代码来源:User.php

示例4: beforeFind

 public function beforeFind()
 {
     $attrs = $this->attributeLabels();
     if ($this->tableName() != "sites") {
         if (@$attrs['site_id']) {
             $this->getDbCriteria()->mergeWith(array('alias' => 't', 'condition' => "t.site_id=" . (int) Sites::model()->getCurrentSite()->id));
         }
     }
     //var_dump($this->dbCriteria);
     parent::beforeFind();
 }
开发者ID:jwerd,项目名称:coupon,代码行数:11,代码来源:MasterActiveRecord.php

示例5: beforeSave

 protected function beforeSave()
 {
     if (parent::beforeFind()) {
         if ($this->isNewRecord) {
             $this->created_at = time();
             $this->score = 100;
         }
         return true;
     }
     return false;
 }
开发者ID:daysun1987,项目名称:daydaynews,代码行数:11,代码来源:User.php

示例6: beforeFind

 protected function beforeFind()
 {
     if (parent::beforeFind()) {
         if ($this->hora_inicio) {
             $this->hora_inicio = Horario::hora($this->hora_inicio, true);
         }
         if ($this->hora_fin) {
             $this->hora_fin = Horario::hora($this->hora_fin, true);
         }
         return true;
     } else {
         return false;
     }
 }
开发者ID:Telemedellin,项目名称:tm,代码行数:14,代码来源:Horario.php

示例7: beforeFind

 protected function beforeFind()
 {
     // Поддержка многих языков после загрузки модели
     $this->languageBehavior->multilang();
     return parent::beforeFind();
 }
开发者ID:DarkAiR,项目名称:test,代码行数:6,代码来源:Articles.php

示例8: beforeFind

    protected function beforeFind()
    {
        $t = $this->tableAlias;
        // Select community ID
        $select = array('(CASE
				WHEN ' . $t . '.identity LIKE "STEAM_%" THEN 76561197960265728 + CAST(SUBSTRING(' . $t . '.identity, 9, 1) AS UNSIGNED) + CAST(SUBSTRING(' . $t . '.identity, 11) * 2 AS UNSIGNED)
				WHEN ' . $t . '.identity LIKE "[U:%]" THEN 76561197960265728 + CAST(SUBSTRING(' . $t . '.identity, 6, CHAR_LENGTH(' . $t . '.identity) - 6) AS UNSIGNED)
			END) AS admin_community_id');
        if ($this->dbCriteria->select === '*') {
            array_unshift($select, '*');
        }
        $this->dbCriteria->mergeWith(array('select' => $select));
        parent::beforeFind();
    }
开发者ID:Saltly,项目名称:SourceBans,代码行数:14,代码来源:SBAdmin.php

示例9: beforeFind

 protected function beforeFind()
 {
     //$this->categorize($this->illust_category_enum);
     return parent::beforeFind();
 }
开发者ID:kittolau,项目名称:gcm,代码行数:5,代码来源:Illust.php

示例10: beforeFind

 protected function beforeFind()
 {
     parent::beforeFind();
     $this->incrementCounter(__FUNCTION__);
 }
开发者ID:salem-dev-acc,项目名称:yiiapp,代码行数:5,代码来源:models.php

示例11: beforeFind

 protected function beforeFind()
 {
     // Xử lý ngôn ngữ
     if ($this->enableLanguage) {
         $tableSchema = $this->getTableSchema();
         if (isset($tableSchema->columns['locale'])) {
             $criteria = new CDbCriteria();
             $criteria->condition = "locale = '" . Yii::app()->language . "'";
             $this->dbCriteria->mergeWith($criteria);
             //$this->setAttribute('locale', Yii::app()->language);
         }
     }
     parent::beforeFind();
 }
开发者ID:phiphi1992,项目名称:alongaydep,代码行数:14,代码来源:PIActiveRecord.php

示例12: beforeFind

 protected function beforeFind()
 {
     $this->enableCache();
     $this->setDbReading();
     parent::beforeFind();
 }
开发者ID:njxjxj,项目名称:yorm,代码行数:6,代码来源:CEntity.php


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