public function behaviors() { $behaviors = ['attributesMapBehavior' => ['class' => '\\yiicod\\mailqueue\\models\\behaviors\\AttributesMapBehavior', 'attributesMap' => Yii::$app->get('mailqueue')->modelMap['MailQueue']], 'timestampBehavior' => ['class' => TimestampBehavior::className(), 'createdAtAttribute' => in_array(Yii::$app->get('mailqueue')->modelMap['MailQueue']['fieldCreateDate'], $this->attributes()) ? Yii::$app->get('mailqueue')->modelMap['MailQueue']['fieldCreateDate'] : null, 'updatedAtAttribute' => in_array(Yii::$app->get('mailqueue')->modelMap['MailQueue']['fieldUpdateDate'], $this->attributes()) ? Yii::$app->get('mailqueue')->modelMap['MailQueue']['fieldUpdateDate'] : null, 'value' => function () { return date("Y-m-d H:i:s"); }], 'XssBehavior' => ['class' => '\\yiicod\\base\\models\\behaviors\\XssBehavior', 'attributesExclude' => array(Yii::$app->get('mailqueue')->modelMap['MailQueue']['fieldBody'])]]; return ArrayHelper::merge(parent::behaviors(), $behaviors); }
public function behaviors() { $result = parent::behaviors(); return array_merge($result, ['timestamp' => ['class' => \yii\behaviors\TimestampBehavior::className(), 'attributes' => [\yii\db\ActiveRecord::EVENT_BEFORE_UPDATE => 'date_update'], 'value' => function () { return date('Y-m-d H:i:s'); }]]); }
/** * @return array Behaviors */ public function behaviors() { $items = parent::behaviors(); if ($this->timeStampBehaviorEnabled && $this->hasAttribute('created_at')) { $items['date'] = ['class' => TimestampBehavior::className(), 'createdAtAttribute' => 'created_at', 'updatedAtAttribute' => $this->hasAttribute('updated_at') ? 'updated_at' : 'created_at', 'value' => function () { return date('Y-m-d H:i:s'); }]; } return $items; }
/** * @inheritdoc */ public function behaviors() { return array_merge(parent::behaviors(), [BlameableBehavior::className() => ['class' => BlameableBehavior::className(), 'value' => function ($event) { if (\Yii::$app instanceof \yii\console\Application) { return null; } else { $user = Yii::$app->get('user', false); return $user && !$user->isGuest ? $user->id : null; } }], TimestampBehavior::className() => ['class' => TimestampBehavior::className()], HasTableCache::className() => ['class' => HasTableCache::className(), 'cache' => \Yii::$app->cache]]); }
/** * (array) behaviors : * @return array */ public function behaviors() { return array_merge(parent::behaviors(), ['timestamp' => ['class' => TimestampBehavior::className()], 'audit' => ['class' => AuditTrailBehavior::className()]]); }
public function behaviors() { return array_merge(parent::behaviors(), ['timestamp' => ['class' => 'yii\\behaviors\\TimestampBehavior', 'attributes' => [ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'], ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at']]], 'slug' => ['class' => 'yii\\behaviors\\SluggableBehavior', 'attribute' => 'title', 'slugAttribute' => 'slug', 'immutable' => true, 'ensureUnique' => true]]); }
/** * @inheritdoc */ public function behaviors() { return ArrayHelper::merge(parent::behaviors(), ['timestamp' => ['class' => TimestampBehavior::className(), 'createdAtAttribute' => 'createdAt', 'updatedAtAttribute' => 'updatedAt']]); }
public function behaviors() { return ArrayHelper::merge(parent::behaviors(), ['timestamp' => ['class' => TimestampBehavior::className(), 'attributes' => [ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'], ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at'], 'value' => function () { return time(); }]]); }
/** * @inheritdoc */ public function behaviors() { return array_merge(parent::behaviors(), [['class' => CascadeBehavior::className(), 'children' => ['files']]]); }
public function behaviors() { return array_merge(parent::behaviors(), ['slug' => ['class' => SluggableBehavior::className(), 'attribute' => 'title', 'slugAttribute' => 'slug', 'immutable' => true, 'ensureUnique' => true]]); }
public function behaviors() { return ArrayHelper::merge(parent::behaviors(), [Relations::className(), ['class' => TimestampBehavior::className()]]); }
/** * @inheritdoc */ public function behaviors() { $behaviors = parent::behaviors(); $behaviors[] = TimestampBehavior::className(); return $behaviors; }
/** * @inheritdoc */ public function behaviors() { $behaviors = parent::behaviors(); $behaviors[] = ['class' => AttachBehavior::className(), 'models' => ['avatar' => ['class' => UserAvatarFile::className()]]]; return $behaviors; }
/** * @inheritdoc */ public function behaviors() { return array_merge(parent::behaviors(), [['class' => CascadeBehavior::className(), 'children' => ['disciplineNames', 'studentEducations', 'files']]]); }
/** * @inheritdoc */ public function behaviors() { return array_merge(parent::behaviors(), [FileBehavior::className()]); }
/** * @inheritdoc */ public function behaviors() { $parentBehaviors = parent::behaviors(); $thisBehaviors = ['relationDelete' => ['class' => RelationsDelete::className(), 'relations' => ['plans', 'prices', 'requests', 'usages']]]; return ArrayHelper::merge($parentBehaviors, $thisBehaviors); }
public function behaviors() { $ret = parent::behaviors(); $ret[] = ['class' => TimestampBehavior::className(), 'value' => new Expression('NOW()')]; return $ret; }
/** * @inheritdoc */ public function behaviors() { return array_merge(parent::behaviors(), [EmailBehavior::className(), 'timestamp' => ['class' => 'yii\\behaviors\\TimestampBehavior', 'attributes' => [self::EVENT_BEFORE_INSERT => ['created_at']]]]); }
public function behaviors() { return ArrayHelper::merge(parent::behaviors(), ['translateable' => ['class' => TranslateableBehavior::className(), 'translationAttributes' => ['to', 'bcc', 'from', 'subject', 'message']], 'timestamp' => ['class' => TimestampBehavior::className(), 'attributes' => [ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'], ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at'], 'value' => function () { return time(); }]]); }
/** * @inheritDoc */ public function behaviors() { return ArrayHelper::merge(parent::behaviors(), ['sort' => ['class' => SortBehavior::class, 'query' => function (AttributeEnumRecord $r) { return AttributeEnumRecord::find()->byRule($r->rule_id); }]]); }
/** * @return array */ public function behaviors() { return array_merge(parent::behaviors(), [HasJsonFieldsBehavior::className() => ['class' => HasJsonFieldsBehavior::className(), 'fields' => ['provider_data']]]); }
/** * @inheritDoc */ public function behaviors() { return ArrayHelper::merge(parent::behaviors(), ['timestamp' => ['class' => TimestampBehavior::className()], 'blame' => ['class' => BlameableBehavior::className()], 'ARLog' => ['class' => ARLogBehavior::className()], 'sortable' => ['class' => SortableModel::className()]]); }
public function behaviors() { return ArrayHelper::merge(parent::behaviors(), ['timestamp' => ['class' => TimestampBehavior::className(), 'attributes' => [ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'], ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at'], 'value' => function () { return time(); }], 'image' => ['class' => 'infoweb\\cms\\behaviors\\ImageBehave'], 'pdf' => ['class' => 'infoweb\\skarabee\\behaviors\\PdfBehave']]); }
public function behaviors() { return array_merge(parent::behaviors(), ['timestamp' => ['class' => 'yii\\behaviors\\TimestampBehavior', 'attributes' => [self::EVENT_BEFORE_INSERT => ['create_time', 'update_time'], self::EVENT_BEFORE_UPDATE => ['update_time']], 'value' => function () { return new Expression('CURRENT_TIMESTAMP'); }], 'blameable' => ['class' => BlameableBehavior::className(), 'createdByAttribute' => 'create_by', 'updatedByAttribute' => false], 'attachments' => ['class' => \nemmo\attachments\behaviors\FileBehavior::className()], 'ip' => ['class' => IpBehavior::className(), 'attributes' => [self::EVENT_BEFORE_INSERT => ['ip']]]]); }
/** * @inheritdoc */ public function behaviors() { return array_merge(parent::behaviors(), [TimestampBehavior::className(), BlameableBehavior::className()]); }
/** * @return array */ public function behaviors() { $rVal = parent::behaviors(); $rVal['timestamp'] = ['class' => SqlToTimestampBehavior::className(), 'attributes' => ['expires_at']]; return $rVal; }
/** * @inheritdoc */ public function behaviors() { return array_merge(parent::behaviors(), [['class' => CascadeBehavior::className(), 'children' => ['disciplineSemesters']]]); }
/** * @inheritdoc; */ public function behaviors() { $behaviors = parent::behaviors(); $behaviors['typecast'] = \cookyii\behaviors\AttributeTypecastBehavior::class; return $behaviors; }
public function behaviors() { return ArrayHelper::merge(parent::behaviors(), [TimestampBehavior::className()]); }
public function behaviors() { return array_merge(parent::behaviors(), [['class' => AttributeBehavior::className(), 'attributes' => [ActiveRecord::EVENT_AFTER_FIND => 'data'], 'value' => function ($event) { return unserialize($this->data); }]]); }