File: D:/HostingSpaces/SBogers10/ste.komma.pro/app/C4/Requests/PutInfoRequest.php
<?php
namespace App\C4\Requests;
class PutInfoRequest
{
const PATH = 'put_infoaanvraag';
public string $gender = '';
public string $last_name;
public string $first_name = '';
public string $phone;
public string $email;
public string $company = '';
public string $interestedIn;
public string $language;
public string $form_message = '';
public bool $newsletter = false;
/**
* Convert attributes for request
*
* @return array
*/
public function getParams(): array
{
return [
'geslacht' => $this->gender,
'achternaam' => $this->last_name,
'voorletters' => $this->first_name,
'telefoonnummer' => $this->phone,
'emailadres' => $this->email,
'organisatie' => $this->company,
'geinteresseerd_in' => $this->interestedIn,
'taal' => $this->language,
'opmerkingen' => $this->form_message,
'inschrijven_nieuwsbrief' => $this->newsletter ? 1 : 0,
];
}
/**
* Fill request into class
*
* @param array $inputs
*/
public function fill(array $inputs)
{
foreach ($inputs as $key => $value) {
$this->{$key} = $value;
}
}
/**
* Extend form message with the form which it is send
*
* @param string $formName
*/
public function assignFormToFormMessage(string $formName)
{
$this->form_message = $formName . PHP_EOL . PHP_EOL . $this->form_message;
}
}