Переименовал классы и добавил выборку из второй БД

This commit is contained in:
2024-08-08 16:38:54 +03:00
parent 1f96b88ac2
commit 0b56cd37b5
8 changed files with 113 additions and 90 deletions

View File

@ -0,0 +1,33 @@
<?php
namespace App\Library;
// Специальность, направление подготовки
class ContingentRow
{
public function __construct(
private string $eduCode,
private string $eduName,
private string $eduLevel,
private string $eduForm,
private int $contingent
) {
if ($contingent < 0) {
throw new \Exception("Недействительная численность обучающихся!");
}
$this->eduCode = $eduCode;
$this->eduName = $eduName;
$this->eduLevel = $eduLevel;
$this->eduForm = $eduForm;
$this->contingent = $contingent;
}
public function getData() : array
{
return [
"spec_code" => $this->eduCode,
"spec_name" => $this->eduName,
"edu_level" => $this->eduLevel,
"edu_forms"=> $this->eduForm,
"contingent" => $this->contingent
];
}
}