1: | <?php declare(strict_types=1); |
2: | |
3: | namespace Salient\Contract\Core\Entity; |
4: | |
5: | use Salient\Contract\Core\Hierarchical; |
6: | |
7: | /** |
8: | * @api |
9: | */ |
10: | interface Treeable extends Hierarchical, Relatable |
11: | { |
12: | /** |
13: | * Get the property that links children to a parent of the same type |
14: | * |
15: | * The property returned must accept `static|null`. |
16: | */ |
17: | public static function getParentProperty(): string; |
18: | |
19: | /** |
20: | * Get the property that links a parent to children of the same type |
21: | * |
22: | * The property returned must accept `iterable<static>`. |
23: | */ |
24: | public static function getChildrenProperty(): string; |
25: | } |
26: |