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


PHP CActiveRecord::behaviors方法代碼示例

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


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

示例1: behaviors

 /**
  * Returns the behaviors used for the model
  *
  * @return array
  * @see YdDressing::modelMap
  */
 public function behaviors()
 {
     if (!empty(Yii::app()->dressing->modelMap[get_class($this)]['behaviors'])) {
         return Yii::app()->dressing->modelMap[get_class($this)]['behaviors'];
     }
     return parent::behaviors();
 }
開發者ID:cornernote,項目名稱:yii-dressing,代碼行數:13,代碼來源:YdActiveRecord.php

示例2: behaviors

 public function behaviors()
 {
     $viewRoute = '/profile';
     if (!Yii::app()->params->isMobileApp) {
         $viewRoute = '/profile/view';
     }
     return array_merge(parent::behaviors(), array('X2LinkableBehavior' => array('class' => 'X2LinkableBehavior', 'module' => 'users', 'viewRoute' => $viewRoute), 'ERememberFiltersBehavior' => array('class' => 'application.components.ERememberFiltersBehavior', 'defaults' => array(), 'defaultStickOnClear' => false)));
 }
開發者ID:dsyman2,項目名稱:X2CRM,代碼行數:8,代碼來源:User.php

示例3: behaviors

 public function behaviors()
 {
     return CMap::mergeArray(parent::behaviors(), array('deletable' => array('class' => 'common.extensions.behaviors.DeletableBehavior', 'relations' => array('photos' => DeletableBehavior::CASCADE))));
 }
開發者ID:andreyantonov78,項目名稱:atmosphera,代碼行數:4,代碼來源:Portfolio.php

示例4: behaviors

 /**
  * Define behaviors
  * @return array
  */
 public function behaviors()
 {
     return array_merge(parent::behaviors(), array('i18n-attribute-messages' => array('class' => 'I18nAttributeMessagesBehavior', 'translationAttributes' => array('title', 'slug', 'book_id'), 'languageSuffixes' => array_keys(Yii::app()->params["languages"]))));
 }
開發者ID:neam,項目名稱:yii-i18n-attribute-messages,代碼行數:8,代碼來源:Chapter.php

示例5: behaviors

 public function behaviors()
 {
     return array_merge(parent::behaviors(), array('LoggableBehavior' => array('class' => 'LoggableBehavior', 'ignored' => array('password'))));
 }
開發者ID:uldisn,項目名稱:yii-user,代碼行數:4,代碼來源:User.php

示例6: behaviors

 public function behaviors()
 {
     parent::behaviors();
     return array('CTimestampBehavior' => array('class' => 'zii.behaviors.CTimestampBehavior'));
 }
開發者ID:nassimrehali,項目名稱:yiisite,代碼行數:5,代碼來源:User.php

示例7: behaviors

 public function behaviors()
 {
     $behaviors = array();
     if ($this->logUserActivity && Yii::app() instanceof CWebApplication) {
         //audit trail behavior
         $behaviors['AuditTrailBehavior'] = array('class' => 'application.modules.users.components.behaviors.AuditTrailBehavior');
     }
     return array_merge(parent::behaviors(), $behaviors);
 }
開發者ID:jacjimus,項目名稱:furahia_mis,代碼行數:9,代碼來源:ActiveRecord.php

示例8: behaviors

 public function behaviors()
 {
     return array_merge(parent::behaviors(), array('RecordLimitBehavior' => array('class' => 'RecordLimitBehavior', 'limit' => Yii::app()->settings->triggerLogMax, 'timestampField' => 'triggeredAt')));
 }
開發者ID:dsyman2,項目名稱:X2CRM,代碼行數:4,代碼來源:TriggerLog.php

示例9: behaviors

 /**
  * Returns the behaviors used for the model
  *
  * @return array
  * @see AuditModule::modelMap
  */
 public function behaviors()
 {
     $audit = Yii::app()->getModule('audit');
     if (!empty($audit->modelMap[get_class($this)]['behaviors'])) {
         return $audit->modelMap[get_class($this)]['behaviors'];
     }
     return parent::behaviors();
 }
開發者ID:Horlacher,項目名稱:yii-audit-module,代碼行數:14,代碼來源:AuditActiveRecord.php

示例10: behaviors

 public function behaviors()
 {
     return array_merge(parent::behaviors(), array('X2LinkableBehavior' => array('class' => 'X2LinkableBehavior', 'module' => 'users', 'viewRoute' => '/profile'), 'ERememberFiltersBehavior' => array('class' => 'application.components.ERememberFiltersBehavior', 'defaults' => array(), 'defaultStickOnClear' => false)));
 }
開發者ID:shayanyi,項目名稱:CRM,代碼行數:4,代碼來源:User.php

示例11: behaviors

 /**
  * Returns the behaviors used for the model
  * @return array
  * @see EmailModule::modelMap
  */
 public function behaviors()
 {
     $email = Yii::app()->getModule('email');
     if (!empty($email->modelMap[get_class($this)]['behaviors'])) {
         return $email->modelMap[get_class($this)]['behaviors'];
     }
     return parent::behaviors();
 }
開發者ID:Khan143,項目名稱:yii-email-module,代碼行數:13,代碼來源:EmailActiveRecord.php

示例12: multilangLabels

 /**
  * Translates model labels and adds language after labels of fields generated by Multilingual behaviors.
  *
  * @param CActiveRecord $model the model to which the labels belong to.
  * @param array $labels the untranslated labels
  * @param string $messageFile the message file to use to do the translation
  * 
  * @return array the translated labels
  */
 public static function multilangLabels($model, $labels, $messageFile = 'admin')
 {
     $behaviors = $model->behaviors();
     $localizedAttributes = array();
     foreach ($behaviors as $behavior) {
         if ($behavior['class'] == 'application.components.behaviors.MultilingualBehavior') {
             foreach ($behavior['localizedAttributes'] as $attribute) {
                 if (!in_array($attribute, $localizedAttributes)) {
                     $localizedAttributes[] = $attribute;
                 }
             }
         }
         if ($behavior['class'] == 'application.components.behaviors.MultilangVirtualAttributesBehavior') {
             foreach ($behavior['attributes'] as $attribute) {
                 if (!in_array($attribute, $localizedAttributes)) {
                     $localizedAttributes[] = $attribute;
                 }
             }
         }
     }
     foreach ($localizedAttributes as $attribute) {
         foreach (Yii::app()->languageManager->languages as $language => $fullLanguage) {
             $labels[$attribute . '_' . $language] = $labels[$attribute] . ' (' . Yii::t($messageFile, $fullLanguage) . ')';
         }
     }
     return $labels;
 }
開發者ID:kostya1017,項目名稱:our,代碼行數:36,代碼來源:AdminHelper.php

示例13: behaviors

 public function behaviors()
 {
     return array_merge(parent::behaviors(), array('CTimestampBehavior' => array('class' => 'zii.behaviors.CTimestampBehavior', 'createAttribute' => 'refreshTime', 'updateAttribute' => 'refreshTime')));
 }
開發者ID:tiger2soft,項目名稱:travelman,代碼行數:4,代碼來源:UserState.php

示例14: behaviors

 public function behaviors()
 {
     return array_merge(parent::behaviors(), array('CSaveRelationsBehavior' => array('class' => 'CSaveRelationsBehavior'), 'TimestampBehavior' => array('class' => 'TimestampBehavior')));
 }
開發者ID:gokhanozgunes,項目名稱:gii-template-collection,代碼行數:4,代碼來源:GActiveRecord.php

示例15: behaviors

 public function behaviors()
 {
     return array_merge(parent::behaviors(), array('i18n-columns' => array('class' => 'I18nColumnsBehavior', 'translationAttributes' => array('title', 'slug'))));
 }
開發者ID:neam,項目名稱:yii-i18n-columns,代碼行數:4,代碼來源:Book.php


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