Completed
Push — ezp-30616 ( ab7e14...128c78 )
by
unknown
17:09
created

BeforeCreateGlobalUrlAliasEvent::getUrlAlias()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace eZ\Publish\Core\Event\URLAlias;
6
7
use eZ\Publish\API\Repository\Values\Content\URLAlias;
8
use eZ\Publish\Core\Event\BeforeEvent;
9
10
final class BeforeCreateGlobalUrlAliasEvent extends BeforeEvent
11
{
12
	public const NAME = 'ezplatform.event.url_alias.create_global.before';
13
14
	private $resource;
15
16
	private $path;
17
18
	private $languageCode;
19
20
	private $forwarding;
21
22
	private $alwaysAvailable;
23
24
	/**
25
     * @var \eZ\Publish\API\Repository\Values\Content\URLAlias|null
26
     */
27
	private $urlAlias;
28
29
30
	public function __construct($resource, $path, $languageCode, $forwarding, $alwaysAvailable)
31
	{
32
		$this->resource = $resource;
33
		$this->path = $path;
34
		$this->languageCode = $languageCode;
35
		$this->forwarding = $forwarding;
36
		$this->alwaysAvailable = $alwaysAvailable;
37
	}
38
39
40
	public function getResource()
41
	{
42
		return $this->resource;
43
	}
44
45
46
	public function getPath()
47
	{
48
		return $this->path;
49
	}
50
51
52
	public function getLanguageCode()
53
	{
54
		return $this->languageCode;
55
	}
56
57
58
	public function getForwarding()
59
	{
60
		return $this->forwarding;
61
	}
62
63
64
	public function getAlwaysAvailable()
65
	{
66
		return $this->alwaysAvailable;
67
	}
68
69
70
	function getUrlAlias(): ?URLAlias
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
71
	{
72
		return $this->urlAlias;
73
	}
74
75
76
	function setUrlAlias(?URLAlias $urlAlias): void
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
77
	{
78
		$this->urlAlias = $urlAlias;
79
	}
80
81
82
	function hasUrlAlias(): bool
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
83
	{
84
		return $this->urlAlias instanceof URLAlias;
85
	}
86
}
87