1 | <?php |
||
19 | class TrashItem extends APITrashItem |
||
20 | { |
||
21 | /** |
||
22 | * Content info of the content object of this trash item. |
||
23 | * |
||
24 | * @var \eZ\Publish\API\Repository\Values\Content\ContentInfo |
||
25 | */ |
||
26 | protected $contentInfo; |
||
27 | |||
28 | /** @var array */ |
||
29 | protected $path; |
||
30 | |||
31 | /** @var \eZ\Publish\API\Repository\Values\Content\Location */ |
||
32 | protected $parentLocation; |
||
33 | |||
34 | /** |
||
35 | * Returns the content info of the content object of this trash item. |
||
36 | * |
||
37 | * @return \eZ\Publish\API\Repository\Values\Content\ContentInfo |
||
38 | */ |
||
39 | public function getContentInfo() |
||
43 | |||
44 | public function getParentLocation(): ?Location |
||
48 | |||
49 | /** |
||
50 | * Function where list of properties are returned. |
||
51 | * |
||
52 | * Override to add dynamic properties |
||
53 | * |
||
54 | * @uses \parent::getProperties() |
||
55 | * |
||
56 | * @param array $dynamicProperties |
||
57 | * |
||
58 | * @return array |
||
59 | */ |
||
60 | protected function getProperties($dynamicProperties = ['contentId', 'path']) |
||
64 | |||
65 | /** |
||
66 | * Magic getter for retrieving convenience properties. |
||
67 | * |
||
68 | * @param string $property The name of the property to retrieve |
||
69 | * |
||
70 | * @return mixed |
||
71 | */ |
||
72 | public function __get($property) |
||
90 | |||
91 | /** |
||
92 | * Magic isset for signaling existence of convenience properties. |
||
93 | * |
||
94 | * @param string $property |
||
95 | * |
||
96 | * @return bool |
||
97 | */ |
||
98 | public function __isset($property) |
||
106 | } |
||
107 |
Let’s assume that you have a directory layout like this:
and let’s assume the following content of
Bar.php
:If both files
OtherDir/Foo.php
andSomeDir/Foo.php
are loaded in the same runtime, you will see a PHP error such as the following:PHP Fatal error: Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.php
However, as
OtherDir/Foo.php
does not necessarily have to be loaded and the error is only triggered if it is loaded beforeOtherDir/Bar.php
, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias: