1: | <?php declare(strict_types=1); |
2: | |
3: | namespace Salient\Contract\Core\Entity; |
4: | |
5: | /** |
6: | * @api |
7: | */ |
8: | interface Extensible |
9: | { |
10: | /** |
11: | * Get the property that stores dynamic properties |
12: | * |
13: | * The property returned must accept `array<string,mixed>` or |
14: | * `\ArrayAccess<string,mixed>`. |
15: | */ |
16: | public static function getDynamicPropertiesProperty(): string; |
17: | |
18: | /** |
19: | * Get the property that stores dynamic property names |
20: | * |
21: | * The property returned must accept `array<string,string>` or |
22: | * `\ArrayAccess<string,string>`. |
23: | */ |
24: | public static function getDynamicPropertyNamesProperty(): string; |
25: | |
26: | /** |
27: | * Get the object's dynamic properties |
28: | * |
29: | * @return array<string,mixed> An array that maps property names to values. |
30: | */ |
31: | public function getDynamicProperties(): array; |
32: | |
33: | /** |
34: | * Set the object's dynamic properties |
35: | * |
36: | * @param array<string,mixed> $values An array that maps property names to |
37: | * values. |
38: | */ |
39: | public function setDynamicProperties(array $values): void; |
40: | |
41: | /** |
42: | * Set the value of a property |
43: | * |
44: | * @param mixed $value |
45: | */ |
46: | public function __set(string $name, $value): void; |
47: | |
48: | /** |
49: | * Get the value of a property, or null if it is not set |
50: | * |
51: | * @return mixed |
52: | */ |
53: | public function __get(string $name); |
54: | |
55: | /** |
56: | * Check if a property is set |
57: | */ |
58: | public function __isset(string $name): bool; |
59: | |
60: | /** |
61: | * Unset a property |
62: | */ |
63: | public function __unset(string $name): void; |
64: | } |
65: |