form_id = $form_id; $message->data = $data; return $message; } public function edit( $form_id, $data ): void { $this->form_id = $form_id; $this->data = $data; } public static function tableName(): string { return '{{%forms_messages}}'; } public function behaviors(): array { return [ TimestampBehavior::class, ]; } public function transactions(): array { return [ self::SCENARIO_DEFAULT => self::OP_ALL, ]; } public function attributeLabels() { return [ 'form_id' => Yii::t('form', 'Form'), 'data' => Yii::t('form', 'Form Data'), ]; } public function getForm() { return $this->hasOne(Form::class, ['id' => 'form_id']); } public static function find(): FormMessageQuery { return new FormMessageQuery(static::class); } }