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,14 +0,0 @@
<?php
class AdditionallyInfo
{
public $bDay;
public $gender;
public function __construct($bDay, $gender) {
$this->bDay = $bDay;
$this->gender = $gender;
}
public function getAdditionallyInfo() {
return $this->bDay . ";" . $this->gender;
}
}

View File

@ -1,17 +0,0 @@
<?php
class Contacts
{
public $countryCode;
public $phoneNumber;
public $email;
public function __construct($countryCode, $phoneNumber, $email){
$this->countryCode = $countryCode;
$this->phoneNumber = $phoneNumber;
$this->email = $email;
}
public function getContacts(){
return $this->countryCode . $this->phoneNumber . ";" . $this->email;
}
}

View File

@ -1,19 +0,0 @@
<?php
class FullName
{
public $surname;
public $name;
public $patronymic;
public function __construct($surname, $name, $patronymic)
{
$this->surname = $surname;
$this->name = $name;
$this->patronymic = $patronymic;
}
public function getFoolName()
{
return $this->surname . ' ' . $this->name . ' ' . $this->patronymic;
}
}

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()
{
}
}