openvk/Web/Models/Entities/GeodbUniversity.php

19 lines
593 B
PHP
Raw Permalink Normal View History

2023-08-02 00:42:03 +03:00
<?php declare(strict_types=1);
namespace openvk\Web\Models\Entities;
use openvk\Web\Models\Repositories\GeodbFaculties;
class GeodbUniversity extends GeodbSchool
{
protected $tableName = "geodb_universities";
function getFaculties(?bool $need_deleted = false, ?bool $simplified = false): \Traversable
{
$faculties = (new GeodbFaculties)->getList($this->getId(), $need_deleted);
foreach ($faculties as $faculty) {
$response = $faculty;
if ($simplified) $response = $response->getSimplified();
yield $response;
}
}
}