1 | <?php |
||
32 | trait OwneredTrait |
||
33 | { |
||
34 | |||
35 | /** |
||
36 | * Owner reference or null if it's root object |
||
37 | * @var AnnotatedInterface|null |
||
38 | */ |
||
39 | private $_owner = null; |
||
40 | |||
41 | /** |
||
42 | * Get document owner. |
||
43 | * |
||
44 | * This might return `null` if there is no owner. |
||
45 | * |
||
46 | * @return AnnotatedInterface Owner |
||
47 | * @Ignored |
||
48 | */ |
||
49 | public function getOwner() |
||
53 | |||
54 | /** |
||
55 | * Get document root. This will traverse through objects |
||
56 | * hierarchy, untill owner-less document is found. |
||
57 | * |
||
58 | * This might return same object instance if there is no owner. |
||
59 | * |
||
60 | * The return value is *guaranteed* to be document instance. |
||
61 | * |
||
62 | * |
||
63 | * |
||
64 | * @return AnnotatedInterface Root document |
||
65 | * @Ignored |
||
66 | */ |
||
67 | 6 | public function getRoot() |
|
78 | |||
79 | /** |
||
80 | * Set class owner |
||
81 | * |
||
82 | * @param AnnotatedInterface|null $owner |
||
83 | * @Ignored |
||
84 | */ |
||
85 | 13 | public function setOwner(AnnotatedInterface $owner = null) |
|
89 | |||
90 | } |
||
91 |