當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。