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('forms', 'Name'), 'data' => Yii::t('forms', 'Form'), 'subject' => Yii::t('forms', 'Subject'), 'from' => Yii::t('forms', 'From E-mail'), 'reply' => Yii::t('forms', 'Reply E-mail'), 'return' => Yii::t('forms', 'Return E-mail'), 'complete_text' => Yii::t('forms', 'Complete Text'), 'complete_page_id' => Yii::t('forms', 'Complete Page'), 'status' => Yii::t('forms', 'Status'), 'captcha' => Yii::t('forms', 'Use Captcha'), ]; } public function getMessages() { return $this->hasMany(FormMessage::class, ['form_id' => 'id']); } public static function find(): FormQuery { return new FormQuery(static::class); } }