<?php declare(strict_types=1);
namespace App\Model;
use App\Entity\Country;
use RuntimeException;
class ContentReportData
{
/**
* @var array<mixed>
*/
private array $data = [];
private ?string $stageName = null;
private ?string $firstName = null;
private ?string $lastName = null;
private ?string $companyName = null;
private ?string $commercialRegistrationNumber = null;
private ?string $email = null;
private ?string $phone = null;
private ?string $address = null;
private ?string $addressAdditional = null;
private ?string $city = null;
private ?string $zipCode = null;
private ?string $country = null;
/**
* @param array<mixed> $data
*/
public function __construct(array $data = [])
{
$this->data = $data;
}
/**
* @return mixed[]
*/
public function getData(): array
{
return $this->data;
}
/**
* @param array<mixed> $data
*/
public function setData(array $data): void
{
$this->data = $data;
}
public function getFirstName(): ?string
{
if (null === $this->firstName && isset($this->data['firstName']) && '' !== $this->data['firstName']) {
if (!is_string($this->data['firstName'])) {
throw new RuntimeException('Invalid data on key "firstName"');
}
$this->firstName = $this->data['firstName'];
}
return $this->firstName;
}
public function setFirstName(string $firstName): void
{
$this->data['firstName'] = $firstName;
$this->firstName = $firstName;
}
public function getLastName(): ?string
{
if (null === $this->lastName && isset($this->data['lastName']) && '' !== $this->data['lastName']) {
if (!is_string($this->data['lastName'])) {
throw new RuntimeException('Invalid data on key "lastName"');
}
$this->lastName = $this->data['lastName'];
}
return $this->lastName;
}
public function setLastName(string $lastName): void
{
$this->data['lastName'] = $lastName;
$this->lastName = $lastName;
}
public function getStageName(): ?string
{
if (null === $this->stageName && isset($this->data['stageName']) && '' !== $this->data['stageName']) {
if (!is_string($this->data['stageName'])) {
throw new RuntimeException('Invalid data on key "stageName"');
}
$this->stageName = $this->data['stageName'];
}
return $this->stageName;
}
public function setStageName(?string $stageName): void
{
$this->data['stageName'] = $stageName;
$this->stageName = $stageName;
}
public function getCompanyName(): ?string
{
if (null === $this->companyName && isset($this->data['companyName']) && '' !== $this->data['companyName']) {
if (!is_string($this->data['companyName'])) {
throw new RuntimeException('Invalid data on key "companyName"');
}
$this->companyName = $this->data['companyName'];
}
return $this->companyName;
}
public function setCompanyName(string $companyName): void
{
$this->data['companyName'] = $companyName;
$this->companyName = $companyName;
}
public function getCommercialRegistrationNumber(): ?string
{
if (null === $this->commercialRegistrationNumber && isset($this->data['commercialRegistrationNumber']) && '' !== $this->data['commercialRegistrationNumber']) {
if (!is_string($this->data['commercialRegistrationNumber'])) {
throw new RuntimeException('Invalid data on key "commercialRegistrationNumber"');
}
$this->commercialRegistrationNumber = $this->data['commercialRegistrationNumber'];
}
return $this->commercialRegistrationNumber;
}
public function setCommercialRegistrationNumber(?string $commercialRegistrationNumber): void
{
$this->data['commercialRegistrationNumber'] = $commercialRegistrationNumber;
$this->commercialRegistrationNumber = $commercialRegistrationNumber;
}
public function getEmail(): ?string
{
if (null === $this->email && isset($this->data['email']) && '' !== $this->data['email']) {
if (!is_string($this->data['email'])) {
throw new RuntimeException('Invalid data on key "email"');
}
$this->email = $this->data['email'];
}
return $this->email;
}
public function setEmail(string $email): void
{
$this->data['email'] = $email;
$this->email = $email;
}
public function getPhone(): ?string
{
if (null === $this->phone && isset($this->data['phone']) && '' !== $this->data['phone']) {
if (!is_string($this->data['phone'])) {
throw new RuntimeException('Invalid data on key "phone"');
}
$this->phone = $this->data['phone'];
}
return $this->phone;
}
public function setPhone(?string $phone): void
{
$this->data['phone'] = $phone;
$this->phone = $phone;
}
public function getAddress(): ?string
{
if (null === $this->address && isset($this->data['address']) && '' !== $this->data['address']) {
if (!is_string($this->data['address'])) {
throw new RuntimeException('Invalid data on key "address"');
}
$this->address = $this->data['address'];
}
return $this->address;
}
public function setAddress(string $address): void
{
$this->data['address'] = $address;
$this->address = $address;
}
public function getZipCode(): ?string
{
if (null === $this->zipCode && isset($this->data['zipCode']) && '' !== $this->data['zipCode']) {
if (!is_string($this->data['zipCode'])) {
throw new RuntimeException('Invalid data on key "zipCode"');
}
$this->zipCode = $this->data['zipCode'];
}
return $this->zipCode;
}
public function setZipCode(string $zipCode): void
{
$this->data['zipCode'] = $zipCode;
$this->zipCode = $zipCode;
}
public function getCity(): ?string
{
if (null === $this->city && isset($this->data['city']) && '' !== $this->data['city']) {
if (!is_string($this->data['city'])) {
throw new RuntimeException('Invalid data on key "city"');
}
$this->city = $this->data['city'];
}
return $this->city;
}
public function setCity(string $city): void
{
$this->data['city'] = $city;
$this->city = $city;
}
public function getAddressAdditional(): ?string
{
if (null === $this->addressAdditional && isset($this->data['addressAdditional']) && '' !== $this->data['addressAdditional']) {
if (!is_string($this->data['addressAdditional'])) {
throw new RuntimeException('Invalid data on key "addressAdditional"');
}
$this->addressAdditional = $this->data['addressAdditional'];
}
return $this->addressAdditional;
}
public function setAddressAdditional(string $addressAdditional): void
{
$this->data['addressAdditional'] = $addressAdditional;
$this->addressAdditional = $addressAdditional;
}
public function getCountry(): ?string
{
if (null === $this->country && isset($this->data['country']) && '' !== $this->data['country']) {
if (!is_string($this->data['country'])) {
throw new RuntimeException('Invalid data on key "country"');
}
$this->country = $this->data['country'];
}
return $this->country;
}
public function setCountry(Country $country): void
{
$countryName = $country->getName();
$this->data['country'] = $countryName;
$this->country = $countryName;
}
}