This commit is contained in:
2024-05-21 17:06:42 +03:00
parent 8254407aae
commit 44f11cbb1d
8 changed files with 95 additions and 102 deletions

View File

@ -1,22 +1,77 @@
<?php
/**
* @property string $surname
* @property string $name
* @property string $patronymic
* @property string $dateOfBirth
* @property string $gender
* @property string $countryCode
* @property string $phoneNumber
* @property string $email
*/
class Information
{
public $foolName;
public $additionallyInfo;
public $contacts;
public string $surname;
public string $name;
public string $patronymic;
public string $dateOfBirth;
public string $gender;
public string $countryCode;
public string $phoneNumber;
public string $email;
public function __construct($foolName, $additionallyInfo, $contacts)
//public $gender;
public function __construct()
{
$this->foolName = $foolName;
$this->additionallyInfo = $additionallyInfo;
$this->contacts = $contacts;
}
public function getFullInformation()
/**
* @param array $dataArray
* @return void
*/
public function load(array $dataArray): void
{
return $this->foolName . ";" . $this->additionallyInfo . ";" . $this->contacts . ";\n";
if ($dataArray) {
$this->surname = $dataArray['surname'] ?? '';
$this->name = $dataArray['name'] ?? '';
$this->patronymic = $dataArray['patronymic'] ?? '';
$this->dateOfBirth = $dataArray['dateOfBirth'] ?? '';
$this->gender = $dataArray['gender'] ?? '';
$this->countryCode = $dataArray['countryCode'] ?? '';
$this->phoneNumber = $dataArray['phoneNumber'] ?? '';
$this->email = $dataArray['email'] ?? '';
}
}
/**
* @param string $key
* @return string|null
*/
public function getByKey(string $key): ?string
{
if (isset($this->{$key})) {
return $this->{$key};
}
return null;
}
/**
* @return string
*/
public function toString(): string
{
return $this->surname . ';' . $this->name . ';' . $this->patronymic . ';' . $this->dateOfBirth . ';' .
$this->gender . ';' . $this->countryCode . ';' . $this->phoneNumber . ';' . $this->email . "\n";
}
public function search()
{
}
}