name = $name; $form->data = $data; $form->subject = $subject; $form->from = $from; $form->reply = $reply; $form->return = $return; $form->complete_text = $complete_text; $form->complete_page_id = $complete_page_id; $form->status = $status; $form->captcha = $captcha; return $form; } public function edit( $name, $data, $subject, $from, $reply, $return, $complete_text, $complete_page_id, $status, $captcha ): void { $this->name = $name; $this->data = $data; $this->subject = $subject; $this->from = $from; $this->reply = $reply; $this->return = $return; $this->complete_text = $complete_text; $this->complete_page_id = $complete_page_id; $this->status = $status; $this->captcha = $captcha; } public static function tableName(): string { return '{{%forms}}'; } public function behaviors(): array { return [ TimestampBehavior::class, ]; } public function transactions(): array { return [ self::SCENARIO_DEFAULT => self::OP_ALL, ]; } public function attributeLabels() { return [ 'name' => Yii::t('form', 'Name'), 'data' => Yii::t('form', 'Form'), 'subject' => Yii::t('form', 'Subject'), 'from' => Yii::t('form', 'From E-mail'), 'reply' => Yii::t('form', 'Reply E-mail'), 'return' => Yii::t('form', 'Return E-mail'), 'complete_text' => Yii::t('form', 'Complete Text'), 'complete_page_id' => Yii::t('form', 'Complete Page'), 'status' => Yii::t('form', 'Status'), 'captcha' => Yii::t('form', 'Use Captcha'), ]; } public function getMessages() { return $this->hasMany(FormMessage::class, ['form_id' => 'id']); } public static function find(): FormQuery { return new FormQuery(static::class); } }