1 | <?php |
||
17 | class Item implements ItemContract |
||
18 | { |
||
19 | use HasAttributes, DisplayRule; |
||
20 | |||
21 | /** |
||
22 | * @var LinkContract |
||
23 | */ |
||
24 | protected $link; |
||
25 | |||
26 | /** |
||
27 | * @var BuilderContract |
||
28 | */ |
||
29 | protected $builder; |
||
30 | |||
31 | /** |
||
32 | * @var Request |
||
33 | */ |
||
34 | protected $request; |
||
35 | |||
36 | /** |
||
37 | * Item constructor. |
||
38 | * @param BuilderContract $builder |
||
39 | * @param AttributesContract $attributes |
||
40 | * @param LinkContract $link |
||
41 | * @param Request $request |
||
42 | */ |
||
43 | 10 | public function __construct(BuilderContract $builder, AttributesContract $attributes, |
|
44 | LinkContract $link, Request $request) |
||
|
|||
45 | { |
||
46 | 10 | $this->builder = $builder; |
|
47 | 10 | $this->attributes = $attributes; |
|
48 | 10 | $this->link = $link; |
|
49 | 10 | $this->request = $request; |
|
50 | 10 | } |
|
51 | |||
52 | /** |
||
53 | * @return Link |
||
54 | */ |
||
55 | 6 | public function getLink() |
|
59 | |||
60 | /** |
||
61 | * @param array $attributes |
||
62 | * @return string |
||
63 | */ |
||
64 | 4 | public function buildAttributes($attributes = []) |
|
72 | |||
73 | /** |
||
74 | * @return bool |
||
75 | */ |
||
76 | 4 | protected function isActive() |
|
83 | |||
84 | /** |
||
85 | * Check is two url equal |
||
86 | * |
||
87 | * @param string $first |
||
88 | * @param string $second |
||
89 | * @return bool |
||
90 | */ |
||
91 | 4 | protected function isUrlEqual($first, $second) |
|
106 | } |