new network model and mfBaseModelV2

This commit is contained in:
2025-12-14 22:15:00 +01:00
parent 12a7598447
commit b4961fd423
12 changed files with 1944 additions and 335 deletions
@@ -238,6 +238,20 @@ class ConstructionConsentProject extends mfBaseModel {
return $where;
}
/**
* @return array{id: int, name: string}[]
*/
public static function getByAdbNetzgebietId(int $adbNetzgebietId): array {
$db = FronkDB::singleton();
$id = $db->escape($adbNetzgebietId);
$res = $db->query(
"SELECT ccp.id, ccp.name FROM `ConstructionConsentProject` ccp
JOIN `ConstructionConsentNetwork` ccn ON ccp.id = ccn.constructionconsentproject_id
WHERE ccn.adb_netzgebiet_id = '{$id}'"
);
return $db->fetch_all_assoc($res) ?? [];
}
public static function hasFaultyOwnerEntries(int $projectId): bool {
if (empty($projectId)) return false;