| 1 | <?php |
||
| 12 | final class BeforeAddRelationEvent extends BeforeEvent |
||
| 13 | { |
||
| 14 | public const NAME = 'ezplatform.event.relation.add.before'; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var \eZ\Publish\API\Repository\Values\Content\VersionInfo |
||
| 18 | */ |
||
| 19 | private $sourceVersion; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var \eZ\Publish\API\Repository\Values\Content\ContentInfo |
||
| 23 | */ |
||
| 24 | private $destinationContent; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var \eZ\Publish\API\Repository\Values\Content\Relation|null |
||
| 28 | */ |
||
| 29 | private $relation; |
||
| 30 | |||
| 31 | |||
| 32 | public function __construct(VersionInfo $sourceVersion, ContentInfo $destinationContent) |
||
| 37 | |||
| 38 | |||
| 39 | public function getSourceVersion(): VersionInfo |
||
| 43 | |||
| 44 | |||
| 45 | public function getDestinationContent(): ContentInfo |
||
| 49 | |||
| 50 | |||
| 51 | function getRelation(): ?Relation |
||
| 55 | |||
| 56 | |||
| 57 | function setRelation(?Relation $relation): void |
||
| 61 | |||
| 62 | |||
| 63 | function hasRelation(): bool |
||
| 67 | } |
||
| 68 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.