|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* SEOmatic plugin for Craft CMS 4 |
|
5
|
|
|
* |
|
6
|
|
|
* A turnkey SEO implementation for Craft CMS that is comprehensive, powerful, and flexible |
|
7
|
|
|
* |
|
8
|
|
|
* @link https://nystudio107.com |
|
9
|
|
|
* @copyright Copyright (c) 2023 nystudio107 |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
namespace nystudio107\seomatic\models\jsonld; |
|
13
|
|
|
|
|
14
|
|
|
use nystudio107\seomatic\models\MetaJsonLd; |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* schema.org version: v15.0-release |
|
18
|
|
|
* Float - Data type: Floating number. |
|
19
|
|
|
* |
|
20
|
|
|
* @author nystudio107 |
|
21
|
|
|
* @package Seomatic |
|
22
|
|
|
* @see https://schema.org/Float |
|
23
|
|
|
*/ |
|
24
|
|
|
class SchemaFloat extends MetaJsonLd implements SchemaFloatInterface, NumberInterface |
|
25
|
|
|
{ |
|
26
|
|
|
use SchemaFloatTrait; |
|
27
|
|
|
use NumberTrait; |
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* The Schema.org Type Name |
|
31
|
|
|
* |
|
32
|
|
|
* @var string |
|
33
|
|
|
*/ |
|
34
|
|
|
public static string $schemaTypeName = 'Float'; |
|
35
|
|
|
|
|
36
|
|
|
/** |
|
37
|
|
|
* The Schema.org Type Scope |
|
38
|
|
|
* |
|
39
|
|
|
* @var string |
|
40
|
|
|
*/ |
|
41
|
|
|
public static string $schemaTypeScope = 'https://schema.org/Float'; |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* The Schema.org Type Extends |
|
45
|
|
|
* |
|
46
|
|
|
* @var string |
|
47
|
|
|
*/ |
|
48
|
|
|
public static string $schemaTypeExtends = 'Number'; |
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* The Schema.org Type Description |
|
52
|
|
|
* |
|
53
|
|
|
* @var string |
|
54
|
|
|
*/ |
|
55
|
|
|
public static string $schemaTypeDescription = 'Data type: Floating number.'; |
|
56
|
|
|
|
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* @inheritdoc |
|
60
|
|
|
*/ |
|
61
|
|
|
public function getSchemaPropertyNames(): array |
|
62
|
|
|
{ |
|
63
|
|
|
return array_keys($this->getSchemaPropertyExpectedTypes()); |
|
64
|
|
|
} |
|
65
|
|
|
|
|
66
|
|
|
|
|
67
|
|
|
/** |
|
68
|
|
|
* @inheritdoc |
|
69
|
|
|
*/ |
|
70
|
|
|
public function getSchemaPropertyExpectedTypes(): array |
|
71
|
|
|
{ |
|
72
|
|
|
return [ |
|
73
|
|
|
|
|
74
|
|
|
]; |
|
75
|
|
|
} |
|
76
|
|
|
|
|
77
|
|
|
|
|
78
|
|
|
/** |
|
79
|
|
|
* @inheritdoc |
|
80
|
|
|
*/ |
|
81
|
|
|
public function getSchemaPropertyDescriptions(): array |
|
82
|
|
|
{ |
|
83
|
|
|
return [ |
|
84
|
|
|
|
|
85
|
|
|
]; |
|
86
|
|
|
} |
|
87
|
|
|
|
|
88
|
|
|
|
|
89
|
|
|
/** |
|
90
|
|
|
* @inheritdoc |
|
91
|
|
|
*/ |
|
92
|
|
|
public function getGoogleRequiredSchema(): array |
|
93
|
|
|
{ |
|
94
|
|
|
return []; |
|
95
|
|
|
} |
|
96
|
|
|
|
|
97
|
|
|
|
|
98
|
|
|
/** |
|
99
|
|
|
* @inheritdoc |
|
100
|
|
|
*/ |
|
101
|
|
|
public function getGoogleRecommendedSchema(): array |
|
102
|
|
|
{ |
|
103
|
|
|
return []; |
|
104
|
|
|
} |
|
105
|
|
|
|
|
106
|
|
|
|
|
107
|
|
|
/** |
|
108
|
|
|
* @inheritdoc |
|
109
|
|
|
*/ |
|
110
|
|
|
public function defineRules(): array |
|
111
|
|
|
{ |
|
112
|
|
|
$rules = parent::defineRules(); |
|
113
|
|
|
$rules = array_merge($rules, [ |
|
114
|
|
|
[$this->getSchemaPropertyNames(), 'validateJsonSchema'], |
|
115
|
|
|
[$this->getGoogleRequiredSchema(), 'required', 'on' => ['google'], 'message' => 'This property is required by Google.'], |
|
116
|
|
|
[$this->getGoogleRecommendedSchema(), 'required', 'on' => ['google'], 'message' => 'This property is recommended by Google.'] |
|
117
|
|
|
]); |
|
118
|
|
|
|
|
119
|
|
|
return $rules; |
|
120
|
|
|
} |
|
121
|
|
|
} |
|
122
|
|
|
|