public function behaviors() { $behaviors = ['sluggable' => ['class' => SluggableBehavior::className(), 'attribute' => 'title', 'ensureUnique' => true, "immutable" => true], SetMaxSortableModel::className()]; $behaviors['timestamp'] = TimestampBehavior::className(); $behaviors['published_at'] = ['class' => \hass\base\behaviors\StrToTimeBehavior::className(), "attribute" => "published_at"]; $behaviors["meta"] = MetaBehavior::className(); $behaviors["thumbnailFile"] = ['class' => \hass\attachment\behaviors\UploadBehavior::className(), 'attribute' => 'thumbnail']; $behaviors["textEditor"] = ['class' => \hass\base\misc\editor\EditorBehavior::className(), 'attribute' => 'content']; $behaviors["TimestampFormatter"] = TimestampFormatter::className(); $behaviors["commentEnabled"] = ['class' => CommentBehavior::className(), 'defaultStatus' => CommentEnabledEnum::STATUS_ON]; return $behaviors; }
public function behaviors() { $behaviors = [SetMaxSortableModel::className()]; $behaviors["thumbnailFile"] = ['class' => \hass\attachment\behaviors\UploadBehavior::className(), 'attribute' => 'thumbnail']; return $behaviors; }