1 | <?php |
||
2 | /** |
||
3 | * Created by PhpStorm. |
||
4 | * User: sergeykarakhanyan |
||
5 | * Date: 12/23/18 |
||
6 | * Time: 13:51 |
||
7 | */ |
||
8 | |||
9 | namespace Lionix\SeoManager; |
||
10 | |||
11 | use Lionix\SeoManager\Traits\SeoManagerTrait; |
||
12 | |||
13 | class SeoManager |
||
14 | { |
||
15 | use SeoManagerTrait; |
||
0 ignored issues
–
show
introduced
by
![]() |
|||
16 | |||
17 | /** |
||
18 | * Get the array of the Seo meta data |
||
19 | * @param $property |
||
20 | * @return mixed |
||
21 | */ |
||
22 | public function metaData($property = null) |
||
23 | { |
||
24 | return $this->getMetaData($property); |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * Get Meta Keywords formatted |
||
29 | * @return mixed |
||
30 | */ |
||
31 | public function metaKeywords() |
||
32 | { |
||
33 | return $this->getMetaData('keywords'); |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * Get Title |
||
38 | * @return mixed |
||
39 | */ |
||
40 | public function metaTitle() |
||
41 | { |
||
42 | return $this->getMetaData('title'); |
||
43 | |||
44 | } |
||
45 | |||
46 | /** |
||
47 | * Get URL |
||
48 | * @return mixed |
||
49 | */ |
||
50 | public function metaUrl() |
||
51 | { |
||
52 | return $this->getMetaData('url'); |
||
53 | |||
54 | } |
||
55 | |||
56 | /** |
||
57 | * Get Meta Author |
||
58 | * @return mixed |
||
59 | */ |
||
60 | public function metaAuthor() |
||
61 | { |
||
62 | return $this->getMetaData('author'); |
||
63 | } |
||
64 | |||
65 | /** |
||
66 | * Get Meta Description |
||
67 | * @return mixed |
||
68 | */ |
||
69 | public function metaDescription() |
||
70 | { |
||
71 | return $this->getMetaData('description'); |
||
72 | } |
||
73 | |||
74 | /** |
||
75 | * Get dynamically generated title based on users mapping |
||
76 | * @return mixed |
||
77 | */ |
||
78 | public function metaTitleDynamic() |
||
79 | { |
||
80 | return $this->getMetaData('title_dynamic'); |
||
81 | } |
||
82 | |||
83 | /** |
||
84 | * Get Open Graph Data |
||
85 | * @param $property |
||
86 | * @return mixed |
||
87 | */ |
||
88 | public function metaOpenGraph($property = null) |
||
89 | { |
||
90 | $og_data = $this->getMetaData('og_data'); |
||
91 | if (!is_null($property) && isset($og_data[$property])) { |
||
92 | return $og_data[$property]; |
||
93 | } |
||
94 | return $this->getMetaData('og_data'); |
||
95 | } |
||
96 | } |
||
97 |