RelationRepositoryInterface.php

Code Hygiene Score: 100

Keine Issues gefunden.

Dependencies 1

Klassen 1

Funktionen 8

Verwendet von 7

Versionen 2

Code

<?php

declare(strict_types=1);

namespace Domain\Repository;

// @responsibility: Interface für Relation-Persistenz (Entity-Beziehungen)

use Domain\Constants;

interface RelationRepositoryInterface
{
    /**
     * Holt gefilterte Relationen mit Entity-Details.
     *
     * @return array<int, array{id: int, source_entity_id: int, target_entity_id: int, relation_type: string, strength: float, source_name: string, source_type: string, target_name: string, target_type: string}>
     */
    public function findFiltered(string $type = '', int $limit = Constants::DEFAULT_LIMIT): array;

    /**
     * Holt Relation-Typen mit Count.
     *
     * @return array<int, array{relation_type: string, count: int}>
     */
    public function getTypes(): array;

    /**
     * Holt Relation-Statistiken.
     *
     * @return array{total: int, sources: int, targets: int}
     */
    public function getStats(): array;

    /**
     * Findet eine Relation nach ID.
     *
     * @return array|null
     */
    public function find(int $id): ?array;

    /**
     * Erstellt eine neue Relation.
     *
     * @return int ID der neuen Relation
     */
    public function create(int $sourceId, int $targetId, string $type, float $strength = 1.0): int;

    /**
     * Aktualisiert eine Relation.
     */
    public function update(int $id, string $type, float $strength): bool;

    /**
     * Löscht eine Relation.
     */
    public function delete(int $id): bool;

    /**
     * Holt vordefinierte Relation-Typen.
     *
     * @return array<string>
     */
    public function getTypesList(): array;
}
← Übersicht Graph