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