@@ -6,29 +6,29 @@ |
||
6 | 6 | |
7 | 7 | class Rating extends Field |
8 | 8 | { |
9 | - /** |
|
10 | - * @return string|void |
|
11 | - */ |
|
12 | - public function build() |
|
13 | - { |
|
14 | - $this->builder->tag = 'select'; |
|
15 | - $this->mergeFieldArgs(); |
|
16 | - return $this->builder->getTag(); |
|
17 | - } |
|
9 | + /** |
|
10 | + * @return string|void |
|
11 | + */ |
|
12 | + public function build() |
|
13 | + { |
|
14 | + $this->builder->tag = 'select'; |
|
15 | + $this->mergeFieldArgs(); |
|
16 | + return $this->builder->getTag(); |
|
17 | + } |
|
18 | 18 | |
19 | - /** |
|
20 | - * @return array |
|
21 | - */ |
|
22 | - public static function required() |
|
23 | - { |
|
24 | - $options = ['' => __('Select a Rating', 'site-reviews')]; |
|
25 | - foreach (range(glsr()->constant('MAX_RATING', RatingModule::class), 1) as $rating) { |
|
26 | - $options[$rating] = sprintf(_n('%s Star', '%s Stars', $rating, 'site-reviews'), $rating); |
|
27 | - } |
|
28 | - return [ |
|
29 | - 'class' => 'glsr-star-rating', |
|
30 | - 'options' => $options, |
|
31 | - 'type' => 'select', |
|
32 | - ]; |
|
33 | - } |
|
19 | + /** |
|
20 | + * @return array |
|
21 | + */ |
|
22 | + public static function required() |
|
23 | + { |
|
24 | + $options = ['' => __('Select a Rating', 'site-reviews')]; |
|
25 | + foreach (range(glsr()->constant('MAX_RATING', RatingModule::class), 1) as $rating) { |
|
26 | + $options[$rating] = sprintf(_n('%s Star', '%s Stars', $rating, 'site-reviews'), $rating); |
|
27 | + } |
|
28 | + return [ |
|
29 | + 'class' => 'glsr-star-rating', |
|
30 | + 'options' => $options, |
|
31 | + 'type' => 'select', |
|
32 | + ]; |
|
33 | + } |
|
34 | 34 | } |
@@ -4,36 +4,36 @@ |
||
4 | 4 | |
5 | 5 | class Form |
6 | 6 | { |
7 | - /** |
|
8 | - * @param string $id |
|
9 | - * @return string |
|
10 | - */ |
|
11 | - public function buildFields($id) |
|
12 | - { |
|
13 | - return array_reduce($this->getFields($id), function ($carry, $field) { |
|
14 | - return $carry.$field; |
|
15 | - }); |
|
16 | - } |
|
7 | + /** |
|
8 | + * @param string $id |
|
9 | + * @return string |
|
10 | + */ |
|
11 | + public function buildFields($id) |
|
12 | + { |
|
13 | + return array_reduce($this->getFields($id), function ($carry, $field) { |
|
14 | + return $carry.$field; |
|
15 | + }); |
|
16 | + } |
|
17 | 17 | |
18 | - /** |
|
19 | - * @param string $id |
|
20 | - * @return array |
|
21 | - */ |
|
22 | - public function getFields($id) |
|
23 | - { |
|
24 | - $fields = []; |
|
25 | - foreach (glsr()->config('forms/'.$id) as $name => $field) { |
|
26 | - $fields[] = new Field(wp_parse_args($field, ['name' => $name])); |
|
27 | - } |
|
28 | - return $fields; |
|
29 | - } |
|
18 | + /** |
|
19 | + * @param string $id |
|
20 | + * @return array |
|
21 | + */ |
|
22 | + public function getFields($id) |
|
23 | + { |
|
24 | + $fields = []; |
|
25 | + foreach (glsr()->config('forms/'.$id) as $name => $field) { |
|
26 | + $fields[] = new Field(wp_parse_args($field, ['name' => $name])); |
|
27 | + } |
|
28 | + return $fields; |
|
29 | + } |
|
30 | 30 | |
31 | - /** |
|
32 | - * @param string $id |
|
33 | - * @return void |
|
34 | - */ |
|
35 | - public function renderFields($id) |
|
36 | - { |
|
37 | - echo $this->buildFields($id); |
|
38 | - } |
|
31 | + /** |
|
32 | + * @param string $id |
|
33 | + * @return void |
|
34 | + */ |
|
35 | + public function renderFields($id) |
|
36 | + { |
|
37 | + echo $this->buildFields($id); |
|
38 | + } |
|
39 | 39 | } |
@@ -6,17 +6,17 @@ |
||
6 | 6 | |
7 | 7 | class StarRating implements PartialContract |
8 | 8 | { |
9 | - /** |
|
10 | - * @return void|string |
|
11 | - */ |
|
12 | - public function build(array $args = []) |
|
13 | - { |
|
14 | - require_once ABSPATH.'wp-admin/includes/template.php'; |
|
15 | - ob_start(); |
|
16 | - wp_star_rating($args); |
|
17 | - $stars = ob_get_clean(); |
|
18 | - return !glsr()->isAdmin() |
|
19 | - ? str_replace(['star-rating', 'star star'], ['glsr-stars', 'glsr-star glsr-star'], $stars) |
|
20 | - : $stars; |
|
21 | - } |
|
9 | + /** |
|
10 | + * @return void|string |
|
11 | + */ |
|
12 | + public function build(array $args = []) |
|
13 | + { |
|
14 | + require_once ABSPATH.'wp-admin/includes/template.php'; |
|
15 | + ob_start(); |
|
16 | + wp_star_rating($args); |
|
17 | + $stars = ob_get_clean(); |
|
18 | + return !glsr()->isAdmin() |
|
19 | + ? str_replace(['star-rating', 'star star'], ['glsr-stars', 'glsr-star glsr-star'], $stars) |
|
20 | + : $stars; |
|
21 | + } |
|
22 | 22 | } |
@@ -10,191 +10,191 @@ |
||
10 | 10 | |
11 | 11 | class SiteReviewsSummary |
12 | 12 | { |
13 | - /** |
|
14 | - * @var array |
|
15 | - */ |
|
16 | - protected $args; |
|
17 | - |
|
18 | - /** |
|
19 | - * @var float |
|
20 | - */ |
|
21 | - protected $averageRating; |
|
22 | - |
|
23 | - /** |
|
24 | - * @var array |
|
25 | - */ |
|
26 | - protected $ratingCounts; |
|
27 | - |
|
28 | - /** |
|
29 | - * @return void|string |
|
30 | - */ |
|
31 | - public function build(array $args = []) |
|
32 | - { |
|
33 | - $this->args = $args; |
|
34 | - $this->ratingCounts = glsr(ReviewManager::class)->getRatingCounts($args); |
|
35 | - if (!array_sum($this->ratingCounts) && $this->isHidden('if_empty')) { |
|
36 | - return; |
|
37 | - } |
|
38 | - $this->averageRating = glsr(Rating::class)->getAverage($this->ratingCounts); |
|
39 | - $this->generateSchema(); |
|
40 | - return glsr(Template::class)->build('templates/reviews-summary', [ |
|
41 | - 'context' => [ |
|
42 | - 'assigned_to' => $this->args['assigned_to'], |
|
43 | - 'category' => $this->args['category'], |
|
44 | - 'class' => $this->getClass(), |
|
45 | - 'id' => $this->args['id'], |
|
46 | - 'percentages' => $this->buildPercentage(), |
|
47 | - 'rating' => $this->buildRating(), |
|
48 | - 'stars' => $this->buildStars(), |
|
49 | - 'text' => $this->buildText(), |
|
50 | - ], |
|
51 | - ]); |
|
52 | - } |
|
53 | - |
|
54 | - /** |
|
55 | - * @return void|string |
|
56 | - */ |
|
57 | - protected function buildPercentage() |
|
58 | - { |
|
59 | - if ($this->isHidden('bars')) { |
|
60 | - return; |
|
61 | - } |
|
62 | - $percentages = preg_filter('/$/', '%', glsr(Rating::class)->getPercentages($this->ratingCounts)); |
|
63 | - $bars = array_reduce(range(glsr()->constant('MAX_RATING', Rating::class), 1), function ($carry, $level) use ($percentages) { |
|
64 | - $label = $this->buildPercentageLabel($this->args['labels'][$level]); |
|
65 | - $background = $this->buildPercentageBackground($percentages[$level]); |
|
66 | - $count = apply_filters('site-reviews/summary/counts', |
|
67 | - $percentages[$level], |
|
68 | - $this->ratingCounts[$level] |
|
69 | - ); |
|
70 | - $percent = $this->buildPercentageCount($count); |
|
71 | - return $carry.glsr(Builder::class)->div($label.$background.$percent, [ |
|
72 | - 'class' => 'glsr-bar', |
|
73 | - ]); |
|
74 | - }); |
|
75 | - return $this->wrap('percentage', $bars); |
|
76 | - } |
|
77 | - |
|
78 | - /** |
|
79 | - * @param string $percent |
|
80 | - * @return string |
|
81 | - */ |
|
82 | - protected function buildPercentageBackground($percent) |
|
83 | - { |
|
84 | - $backgroundPercent = glsr(Builder::class)->span([ |
|
85 | - 'class' => 'glsr-bar-background-percent', |
|
86 | - 'style' => 'width:'.$percent, |
|
87 | - ]); |
|
88 | - return '<span class="glsr-bar-background">'.$backgroundPercent.'</span>'; |
|
89 | - } |
|
90 | - |
|
91 | - /** |
|
92 | - * @param string $count |
|
93 | - * @return string |
|
94 | - */ |
|
95 | - protected function buildPercentageCount($count) |
|
96 | - { |
|
97 | - return '<span class="glsr-bar-percent">'.$count.'</span>'; |
|
98 | - } |
|
99 | - |
|
100 | - /** |
|
101 | - * @param string $label |
|
102 | - * @return string |
|
103 | - */ |
|
104 | - protected function buildPercentageLabel($label) |
|
105 | - { |
|
106 | - return '<span class="glsr-bar-label">'.$label.'</span>'; |
|
107 | - } |
|
108 | - |
|
109 | - /** |
|
110 | - * @return void|string |
|
111 | - */ |
|
112 | - protected function buildRating() |
|
113 | - { |
|
114 | - if ($this->isHidden('rating')) { |
|
115 | - return; |
|
116 | - } |
|
117 | - return $this->wrap('rating', '<span>'.$this->averageRating.'</span>'); |
|
118 | - } |
|
119 | - |
|
120 | - /** |
|
121 | - * @return void|string |
|
122 | - */ |
|
123 | - protected function buildStars() |
|
124 | - { |
|
125 | - if ($this->isHidden('stars')) { |
|
126 | - return; |
|
127 | - } |
|
128 | - $stars = glsr_star_rating($this->averageRating); |
|
129 | - return $this->wrap('stars', $stars); |
|
130 | - } |
|
131 | - |
|
132 | - /** |
|
133 | - * @return void|string |
|
134 | - */ |
|
135 | - protected function buildText() |
|
136 | - { |
|
137 | - if ($this->isHidden('summary')) { |
|
138 | - return; |
|
139 | - } |
|
140 | - $count = intval(array_sum($this->ratingCounts)); |
|
141 | - if (empty($this->args['text'])) { |
|
142 | - // @todo document this change |
|
143 | - $this->args['text'] = _nx( |
|
144 | - '{rating} out of {max} stars (based on {num} review)', |
|
145 | - '{rating} out of {max} stars (based on {num} reviews)', |
|
146 | - $count, |
|
147 | - 'Do not translate {rating}, {max}, and {num}, they are template tags.', |
|
148 | - 'site-reviews' |
|
149 | - ); |
|
150 | - } |
|
151 | - $summary = str_replace( |
|
152 | - ['{rating}', '{max}', '{num}'], |
|
153 | - [$this->averageRating, glsr()->constant('MAX_RATING', Rating::class), $count], |
|
154 | - $this->args['text'] |
|
155 | - ); |
|
156 | - return $this->wrap('text', '<span>'.$summary.'</span>'); |
|
157 | - } |
|
158 | - |
|
159 | - /** |
|
160 | - * @return void |
|
161 | - */ |
|
162 | - protected function generateSchema() |
|
163 | - { |
|
164 | - if (!wp_validate_boolean($this->args['schema'])) { |
|
165 | - return; |
|
166 | - } |
|
167 | - glsr(Schema::class)->store( |
|
168 | - glsr(Schema::class)->buildSummary($this->args) |
|
169 | - ); |
|
170 | - } |
|
171 | - |
|
172 | - /** |
|
173 | - * @return string |
|
174 | - */ |
|
175 | - protected function getClass() |
|
176 | - { |
|
177 | - return trim('glsr-summary glsr-default '.$this->args['class']); |
|
178 | - } |
|
179 | - |
|
180 | - /** |
|
181 | - * @param string $key |
|
182 | - * @return bool |
|
183 | - */ |
|
184 | - protected function isHidden($key) |
|
185 | - { |
|
186 | - return in_array($key, $this->args['hide']); |
|
187 | - } |
|
188 | - |
|
189 | - /** |
|
190 | - * @param string $key |
|
191 | - * @param string $value |
|
192 | - * @return string |
|
193 | - */ |
|
194 | - protected function wrap($key, $value) |
|
195 | - { |
|
196 | - return glsr(Builder::class)->div($value, [ |
|
197 | - 'class' => 'glsr-summary-'.$key, |
|
198 | - ]); |
|
199 | - } |
|
13 | + /** |
|
14 | + * @var array |
|
15 | + */ |
|
16 | + protected $args; |
|
17 | + |
|
18 | + /** |
|
19 | + * @var float |
|
20 | + */ |
|
21 | + protected $averageRating; |
|
22 | + |
|
23 | + /** |
|
24 | + * @var array |
|
25 | + */ |
|
26 | + protected $ratingCounts; |
|
27 | + |
|
28 | + /** |
|
29 | + * @return void|string |
|
30 | + */ |
|
31 | + public function build(array $args = []) |
|
32 | + { |
|
33 | + $this->args = $args; |
|
34 | + $this->ratingCounts = glsr(ReviewManager::class)->getRatingCounts($args); |
|
35 | + if (!array_sum($this->ratingCounts) && $this->isHidden('if_empty')) { |
|
36 | + return; |
|
37 | + } |
|
38 | + $this->averageRating = glsr(Rating::class)->getAverage($this->ratingCounts); |
|
39 | + $this->generateSchema(); |
|
40 | + return glsr(Template::class)->build('templates/reviews-summary', [ |
|
41 | + 'context' => [ |
|
42 | + 'assigned_to' => $this->args['assigned_to'], |
|
43 | + 'category' => $this->args['category'], |
|
44 | + 'class' => $this->getClass(), |
|
45 | + 'id' => $this->args['id'], |
|
46 | + 'percentages' => $this->buildPercentage(), |
|
47 | + 'rating' => $this->buildRating(), |
|
48 | + 'stars' => $this->buildStars(), |
|
49 | + 'text' => $this->buildText(), |
|
50 | + ], |
|
51 | + ]); |
|
52 | + } |
|
53 | + |
|
54 | + /** |
|
55 | + * @return void|string |
|
56 | + */ |
|
57 | + protected function buildPercentage() |
|
58 | + { |
|
59 | + if ($this->isHidden('bars')) { |
|
60 | + return; |
|
61 | + } |
|
62 | + $percentages = preg_filter('/$/', '%', glsr(Rating::class)->getPercentages($this->ratingCounts)); |
|
63 | + $bars = array_reduce(range(glsr()->constant('MAX_RATING', Rating::class), 1), function ($carry, $level) use ($percentages) { |
|
64 | + $label = $this->buildPercentageLabel($this->args['labels'][$level]); |
|
65 | + $background = $this->buildPercentageBackground($percentages[$level]); |
|
66 | + $count = apply_filters('site-reviews/summary/counts', |
|
67 | + $percentages[$level], |
|
68 | + $this->ratingCounts[$level] |
|
69 | + ); |
|
70 | + $percent = $this->buildPercentageCount($count); |
|
71 | + return $carry.glsr(Builder::class)->div($label.$background.$percent, [ |
|
72 | + 'class' => 'glsr-bar', |
|
73 | + ]); |
|
74 | + }); |
|
75 | + return $this->wrap('percentage', $bars); |
|
76 | + } |
|
77 | + |
|
78 | + /** |
|
79 | + * @param string $percent |
|
80 | + * @return string |
|
81 | + */ |
|
82 | + protected function buildPercentageBackground($percent) |
|
83 | + { |
|
84 | + $backgroundPercent = glsr(Builder::class)->span([ |
|
85 | + 'class' => 'glsr-bar-background-percent', |
|
86 | + 'style' => 'width:'.$percent, |
|
87 | + ]); |
|
88 | + return '<span class="glsr-bar-background">'.$backgroundPercent.'</span>'; |
|
89 | + } |
|
90 | + |
|
91 | + /** |
|
92 | + * @param string $count |
|
93 | + * @return string |
|
94 | + */ |
|
95 | + protected function buildPercentageCount($count) |
|
96 | + { |
|
97 | + return '<span class="glsr-bar-percent">'.$count.'</span>'; |
|
98 | + } |
|
99 | + |
|
100 | + /** |
|
101 | + * @param string $label |
|
102 | + * @return string |
|
103 | + */ |
|
104 | + protected function buildPercentageLabel($label) |
|
105 | + { |
|
106 | + return '<span class="glsr-bar-label">'.$label.'</span>'; |
|
107 | + } |
|
108 | + |
|
109 | + /** |
|
110 | + * @return void|string |
|
111 | + */ |
|
112 | + protected function buildRating() |
|
113 | + { |
|
114 | + if ($this->isHidden('rating')) { |
|
115 | + return; |
|
116 | + } |
|
117 | + return $this->wrap('rating', '<span>'.$this->averageRating.'</span>'); |
|
118 | + } |
|
119 | + |
|
120 | + /** |
|
121 | + * @return void|string |
|
122 | + */ |
|
123 | + protected function buildStars() |
|
124 | + { |
|
125 | + if ($this->isHidden('stars')) { |
|
126 | + return; |
|
127 | + } |
|
128 | + $stars = glsr_star_rating($this->averageRating); |
|
129 | + return $this->wrap('stars', $stars); |
|
130 | + } |
|
131 | + |
|
132 | + /** |
|
133 | + * @return void|string |
|
134 | + */ |
|
135 | + protected function buildText() |
|
136 | + { |
|
137 | + if ($this->isHidden('summary')) { |
|
138 | + return; |
|
139 | + } |
|
140 | + $count = intval(array_sum($this->ratingCounts)); |
|
141 | + if (empty($this->args['text'])) { |
|
142 | + // @todo document this change |
|
143 | + $this->args['text'] = _nx( |
|
144 | + '{rating} out of {max} stars (based on {num} review)', |
|
145 | + '{rating} out of {max} stars (based on {num} reviews)', |
|
146 | + $count, |
|
147 | + 'Do not translate {rating}, {max}, and {num}, they are template tags.', |
|
148 | + 'site-reviews' |
|
149 | + ); |
|
150 | + } |
|
151 | + $summary = str_replace( |
|
152 | + ['{rating}', '{max}', '{num}'], |
|
153 | + [$this->averageRating, glsr()->constant('MAX_RATING', Rating::class), $count], |
|
154 | + $this->args['text'] |
|
155 | + ); |
|
156 | + return $this->wrap('text', '<span>'.$summary.'</span>'); |
|
157 | + } |
|
158 | + |
|
159 | + /** |
|
160 | + * @return void |
|
161 | + */ |
|
162 | + protected function generateSchema() |
|
163 | + { |
|
164 | + if (!wp_validate_boolean($this->args['schema'])) { |
|
165 | + return; |
|
166 | + } |
|
167 | + glsr(Schema::class)->store( |
|
168 | + glsr(Schema::class)->buildSummary($this->args) |
|
169 | + ); |
|
170 | + } |
|
171 | + |
|
172 | + /** |
|
173 | + * @return string |
|
174 | + */ |
|
175 | + protected function getClass() |
|
176 | + { |
|
177 | + return trim('glsr-summary glsr-default '.$this->args['class']); |
|
178 | + } |
|
179 | + |
|
180 | + /** |
|
181 | + * @param string $key |
|
182 | + * @return bool |
|
183 | + */ |
|
184 | + protected function isHidden($key) |
|
185 | + { |
|
186 | + return in_array($key, $this->args['hide']); |
|
187 | + } |
|
188 | + |
|
189 | + /** |
|
190 | + * @param string $key |
|
191 | + * @param string $value |
|
192 | + * @return string |
|
193 | + */ |
|
194 | + protected function wrap($key, $value) |
|
195 | + { |
|
196 | + return glsr(Builder::class)->div($value, [ |
|
197 | + 'class' => 'glsr-summary-'.$key, |
|
198 | + ]); |
|
199 | + } |
|
200 | 200 | } |
@@ -19,12 +19,12 @@ |
||
19 | 19 | */ |
20 | 20 | class Thing extends BaseType |
21 | 21 | { |
22 | - /** |
|
23 | - * @var array |
|
24 | - * @see http://schema.org/{property_name} |
|
25 | - */ |
|
26 | - public $allowed = [ |
|
27 | - 'additionalType', 'alternateName', 'description', 'disambiguatingDescription', 'identifier', |
|
28 | - 'image', 'mainEntityOfPage', 'name', 'potentialAction', 'sameAs', 'url', |
|
29 | - ]; |
|
22 | + /** |
|
23 | + * @var array |
|
24 | + * @see http://schema.org/{property_name} |
|
25 | + */ |
|
26 | + public $allowed = [ |
|
27 | + 'additionalType', 'alternateName', 'description', 'disambiguatingDescription', 'identifier', |
|
28 | + 'image', 'mainEntityOfPage', 'name', 'potentialAction', 'sameAs', 'url', |
|
29 | + ]; |
|
30 | 30 | } |
@@ -4,19 +4,19 @@ |
||
4 | 4 | |
5 | 5 | class UnknownType extends BaseType |
6 | 6 | { |
7 | - /** |
|
8 | - * @var array |
|
9 | - * @see http://schema.org/{property_name} |
|
10 | - */ |
|
11 | - public $allowed = [ |
|
12 | - 'aggregateRating', |
|
13 | - ]; |
|
7 | + /** |
|
8 | + * @var array |
|
9 | + * @see http://schema.org/{property_name} |
|
10 | + */ |
|
11 | + public $allowed = [ |
|
12 | + 'aggregateRating', |
|
13 | + ]; |
|
14 | 14 | |
15 | - /** |
|
16 | - * @var array |
|
17 | - * @see http://schema.org/{property_name} |
|
18 | - */ |
|
19 | - public $parents = [ |
|
20 | - 'Thing', |
|
21 | - ]; |
|
15 | + /** |
|
16 | + * @var array |
|
17 | + * @see http://schema.org/{property_name} |
|
18 | + */ |
|
19 | + public $parents = [ |
|
20 | + 'Thing', |
|
21 | + ]; |
|
22 | 22 | } |
@@ -4,22 +4,22 @@ |
||
4 | 4 | |
5 | 5 | interface Type |
6 | 6 | { |
7 | - /** |
|
8 | - * Return an array representation of the type. If the array contains child types, |
|
9 | - * their context needs to be stripped if it's the same. |
|
10 | - * @return array |
|
11 | - */ |
|
12 | - public function toArray(); |
|
7 | + /** |
|
8 | + * Return an array representation of the type. If the array contains child types, |
|
9 | + * their context needs to be stripped if it's the same. |
|
10 | + * @return array |
|
11 | + */ |
|
12 | + public function toArray(); |
|
13 | 13 | |
14 | - /** |
|
15 | - * Create a json-ld script tag for this type, built from the data that `toArray` returns. |
|
16 | - * @return string |
|
17 | - */ |
|
18 | - public function toScript(); |
|
14 | + /** |
|
15 | + * Create a json-ld script tag for this type, built from the data that `toArray` returns. |
|
16 | + * @return string |
|
17 | + */ |
|
18 | + public function toScript(); |
|
19 | 19 | |
20 | - /** |
|
21 | - * Create a json-ld script tag for this type, built from the data that `toArray` returns. |
|
22 | - * @return string |
|
23 | - */ |
|
24 | - public function __toString(); |
|
20 | + /** |
|
21 | + * Create a json-ld script tag for this type, built from the data that `toArray` returns. |
|
22 | + * @return string |
|
23 | + */ |
|
24 | + public function __toString(); |
|
25 | 25 | } |
@@ -57,166 +57,166 @@ |
||
57 | 57 | */ |
58 | 58 | class Organization extends BaseType |
59 | 59 | { |
60 | - /** |
|
61 | - * The schema.org Actions mechanism benefited from extensive discussions across the Web |
|
62 | - * standards community around W3C, in particular from the [Hydra project](http://purl.org/hydra/) |
|
63 | - * community group. |
|
64 | - * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_ActionCollabClass |
|
65 | - */ |
|
66 | - const ActionCollabClass = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_ActionCollabClass'; |
|
67 | - |
|
68 | - /** |
|
69 | - * This element is based on the work of the Automotive Ontology Working Group, |
|
70 | - * see [www.automotive-ontology.org](http://www.automotive-ontology.org) for details. |
|
71 | - * Many class and property definitions are inspired by or based on abstracts from Wikipedia, |
|
72 | - * the free encyclopedia. |
|
73 | - * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#Automotive_Ontology_Working_Group |
|
74 | - */ |
|
75 | - const AutomotiveOntologyWGClass = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#Automotive_Ontology_Working_Group'; |
|
76 | - |
|
77 | - /** |
|
78 | - * The W3C [Schema Bib Extend](http://www.w3.org/community/schemabibex/) (BibEx) group led the |
|
79 | - * work to improve schema.org for bibliographic information, including terms for periodicals, |
|
80 | - * articles and multi-volume works. The design was inspired in places (e.g. [[pageStart]], |
|
81 | - * [[pageEnd]], [[pagination]]) by the [Bibliographic Ontology](http://bibliontology.com/), |
|
82 | - * 'bibo'. |
|
83 | - * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_bibex |
|
84 | - */ |
|
85 | - const BibExTerm = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_bibex'; |
|
86 | - |
|
87 | - /** |
|
88 | - * This class is based upon W3C DCAT work, and benefits from collaboration around the DCAT, ADMS |
|
89 | - * and VoID vocabularies. See http://www.w3.org/wiki/WebSchemas/Datasets for full details and |
|
90 | - * mappings. |
|
91 | - * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_DatasetClass |
|
92 | - */ |
|
93 | - const DatasetClass = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_DatasetClass'; |
|
94 | - |
|
95 | - /** |
|
96 | - * This element is based on the work of the Financial Industry Business Ontology project (see |
|
97 | - * [http://www.fibo.org/schema](http://www.fibo.org/schema) for details), in support of the W3C |
|
98 | - * Financial Industry Business Ontology Community Group |
|
99 | - * ([http://www.fibo.org/community](http://www.fibo.org/community)). Many class and property |
|
100 | - * definitions are inspired by or based on [http://www.fibo.org](http://www.fibo.org). |
|
101 | - * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#FIBO |
|
102 | - */ |
|
103 | - const FIBO = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#FIBO'; |
|
104 | - |
|
105 | - /** |
|
106 | - * The implementation and use of Legal Entity Identifier (LEI) is supported by Global Legal |
|
107 | - * Entity Identifier Foundation [https://www.gleif.org](https://www.gleif.org). |
|
108 | - * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#GLEIF |
|
109 | - */ |
|
110 | - const GLEIF = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#GLEIF'; |
|
111 | - |
|
112 | - /** |
|
113 | - * This class is derived from the GoodRelations Vocabulary for E-Commerce, created by Martin |
|
114 | - * Hepp. GoodRelations is a data model for sharing e-commerce data on the Web that can be |
|
115 | - * expressed in a variety of syntaxes, including RDFa and HTML5 Microdata. More information |
|
116 | - * about GoodRelations can be found at |
|
117 | - * [http://purl.org/goodrelations/](http://purl.org/goodrelations/). |
|
118 | - * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_GoodRelationsClass |
|
119 | - */ |
|
120 | - const GoodRelationsClass = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_GoodRelationsClass'; |
|
121 | - |
|
122 | - /** |
|
123 | - * This term [uses](http://blog.schema.org/2012/11/good-relations-and-schemaorg.html) |
|
124 | - * terminology from the GoodRelations Vocabulary for E-Commerce, created by Martin Hepp. |
|
125 | - * GoodRelations is a data model for sharing e-commerce data on the Web. More information about |
|
126 | - * GoodRelations can be found at |
|
127 | - * [http://purl.org/goodrelations/](http://purl.org/goodrelations/). |
|
128 | - * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_GoodRelationsTerms |
|
129 | - */ |
|
130 | - const GoodRelationsTerms = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_GoodRelationsTerms'; |
|
131 | - |
|
132 | - /** |
|
133 | - * This element is based on work by the Web Applications for the Future Internet Lab, Institute |
|
134 | - * of Informatics and Telematics, Pisa, Italy. |
|
135 | - * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#IIT-CNR.it |
|
136 | - */ |
|
137 | - const IITCNRit = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#IIT-CNR.it'; |
|
138 | - |
|
139 | - /** |
|
140 | - * This class is based on the work of the LRMI project, see lrmi.net for details. |
|
141 | - * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_LRMIClass |
|
142 | - */ |
|
143 | - const LRMIClass = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_LRMIClass'; |
|
144 | - |
|
145 | - /** |
|
146 | - * This vocabulary was improved through collaboration with the MusicBrainz project |
|
147 | - * ([www.musicbrainz.org](http://www.musicbrainz.org)), and is partially inspired by the |
|
148 | - * MusicBrainz and |
|
149 | - * [Music Ontology](http://musicontology.com/docs/getting-started.html) schemas. |
|
150 | - * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#MBZ |
|
151 | - */ |
|
152 | - const MBZ = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#MBZ'; |
|
153 | - |
|
154 | - /** |
|
155 | - * This element is based on the STI Accommodation Ontology, see <a |
|
156 | - * href="http://ontologies.sti-innsbruck.at/acco/ns.html">http://ontologies.sti-innsbruck.at/acco/ns.html</a> |
|
157 | - * for details. |
|
158 | - * Many class and property definitions are inspired by or based on abstracts from Wikipedia, |
|
159 | - * the free encyclopedia. |
|
160 | - * @see https://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#STI_Accommodation_Ontology |
|
161 | - */ |
|
162 | - const STI_Accommodation_Ontology = 'https://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#STI_Accommodation_Ontology'; |
|
163 | - |
|
164 | - /** |
|
165 | - * The Question/Answer types were [based |
|
166 | - * on](https://www.w3.org/wiki/WebSchemas/QASchemaResearch) the Stack Overflow API. |
|
167 | - * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_QAStackExchange |
|
168 | - */ |
|
169 | - const Stack_Exchange = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_QAStackExchange'; |
|
170 | - |
|
171 | - /** |
|
172 | - * This term and associated definitions draws upon the work of [The Trust |
|
173 | - * Project](http://thetrustproject.org/). |
|
174 | - * @see https://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#TP-draws |
|
175 | - */ |
|
176 | - const The_Trust_Project = 'https://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#TP-draws'; |
|
177 | - |
|
178 | - /** |
|
179 | - * This element is based on the work of the [Tourism Structured Web Data Community |
|
180 | - * Group](https://www.w3.org/community/tourismdata). |
|
181 | - * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#Tourism |
|
182 | - */ |
|
183 | - const Tourism = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#Tourism'; |
|
184 | - |
|
185 | - /** |
|
186 | - * This class contains information contributed by |
|
187 | - * [http://wikidoc.org>WikiDoc](http://wikidoc.org>WikiDoc). |
|
188 | - * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_WikiDoc |
|
189 | - */ |
|
190 | - const WikiDoc = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_WikiDoc'; |
|
191 | - |
|
192 | - /** |
|
193 | - * This class contains derivatives of IPTC rNews properties. rNews is a data model of publishing |
|
194 | - * metadata with serializations currently available for RDFa as well as HTML5 Microdata. More |
|
195 | - * information about the IPTC and rNews can be found at [rnews.org](http://rnews.org). |
|
196 | - * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_rNews |
|
197 | - */ |
|
198 | - const rNews = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_rNews'; |
|
199 | - |
|
200 | - /** |
|
201 | - * @var array |
|
202 | - * @see http://schema.org/{property_name} |
|
203 | - */ |
|
204 | - public $allowed = [ |
|
205 | - 'address', 'aggregateRating', 'areaServed', 'award', 'awards', 'brand', 'contactPoint', |
|
206 | - 'contactPoints', 'department', 'dissolutionDate', 'duns', 'email', 'employee', 'employees', |
|
207 | - 'event', 'events', 'faxNumber', 'founder', 'founders', 'foundingDate', 'foundingLocation', |
|
208 | - 'funder', 'globalLocationNumber', 'hasOfferCatalog', 'hasPOS', 'isicV4', 'legalName', |
|
209 | - 'leiCode', 'location', 'logo', 'makesOffer', 'member', 'memberOf', 'members', 'naics', |
|
210 | - 'numberOfEmployees', 'offeredBy', 'owns', 'parentOrganization', 'publishingPrinciples', |
|
211 | - 'review', 'reviews', 'seeks', 'serviceArea', 'sponsor', 'subOrganization', 'taxID', |
|
212 | - 'telephone', 'vatID', |
|
213 | - ]; |
|
214 | - |
|
215 | - /** |
|
216 | - * @var array |
|
217 | - * @see http://schema.org/{property_name} |
|
218 | - */ |
|
219 | - public $parents = [ |
|
220 | - 'Thing', |
|
221 | - ]; |
|
60 | + /** |
|
61 | + * The schema.org Actions mechanism benefited from extensive discussions across the Web |
|
62 | + * standards community around W3C, in particular from the [Hydra project](http://purl.org/hydra/) |
|
63 | + * community group. |
|
64 | + * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_ActionCollabClass |
|
65 | + */ |
|
66 | + const ActionCollabClass = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_ActionCollabClass'; |
|
67 | + |
|
68 | + /** |
|
69 | + * This element is based on the work of the Automotive Ontology Working Group, |
|
70 | + * see [www.automotive-ontology.org](http://www.automotive-ontology.org) for details. |
|
71 | + * Many class and property definitions are inspired by or based on abstracts from Wikipedia, |
|
72 | + * the free encyclopedia. |
|
73 | + * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#Automotive_Ontology_Working_Group |
|
74 | + */ |
|
75 | + const AutomotiveOntologyWGClass = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#Automotive_Ontology_Working_Group'; |
|
76 | + |
|
77 | + /** |
|
78 | + * The W3C [Schema Bib Extend](http://www.w3.org/community/schemabibex/) (BibEx) group led the |
|
79 | + * work to improve schema.org for bibliographic information, including terms for periodicals, |
|
80 | + * articles and multi-volume works. The design was inspired in places (e.g. [[pageStart]], |
|
81 | + * [[pageEnd]], [[pagination]]) by the [Bibliographic Ontology](http://bibliontology.com/), |
|
82 | + * 'bibo'. |
|
83 | + * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_bibex |
|
84 | + */ |
|
85 | + const BibExTerm = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_bibex'; |
|
86 | + |
|
87 | + /** |
|
88 | + * This class is based upon W3C DCAT work, and benefits from collaboration around the DCAT, ADMS |
|
89 | + * and VoID vocabularies. See http://www.w3.org/wiki/WebSchemas/Datasets for full details and |
|
90 | + * mappings. |
|
91 | + * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_DatasetClass |
|
92 | + */ |
|
93 | + const DatasetClass = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_DatasetClass'; |
|
94 | + |
|
95 | + /** |
|
96 | + * This element is based on the work of the Financial Industry Business Ontology project (see |
|
97 | + * [http://www.fibo.org/schema](http://www.fibo.org/schema) for details), in support of the W3C |
|
98 | + * Financial Industry Business Ontology Community Group |
|
99 | + * ([http://www.fibo.org/community](http://www.fibo.org/community)). Many class and property |
|
100 | + * definitions are inspired by or based on [http://www.fibo.org](http://www.fibo.org). |
|
101 | + * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#FIBO |
|
102 | + */ |
|
103 | + const FIBO = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#FIBO'; |
|
104 | + |
|
105 | + /** |
|
106 | + * The implementation and use of Legal Entity Identifier (LEI) is supported by Global Legal |
|
107 | + * Entity Identifier Foundation [https://www.gleif.org](https://www.gleif.org). |
|
108 | + * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#GLEIF |
|
109 | + */ |
|
110 | + const GLEIF = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#GLEIF'; |
|
111 | + |
|
112 | + /** |
|
113 | + * This class is derived from the GoodRelations Vocabulary for E-Commerce, created by Martin |
|
114 | + * Hepp. GoodRelations is a data model for sharing e-commerce data on the Web that can be |
|
115 | + * expressed in a variety of syntaxes, including RDFa and HTML5 Microdata. More information |
|
116 | + * about GoodRelations can be found at |
|
117 | + * [http://purl.org/goodrelations/](http://purl.org/goodrelations/). |
|
118 | + * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_GoodRelationsClass |
|
119 | + */ |
|
120 | + const GoodRelationsClass = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_GoodRelationsClass'; |
|
121 | + |
|
122 | + /** |
|
123 | + * This term [uses](http://blog.schema.org/2012/11/good-relations-and-schemaorg.html) |
|
124 | + * terminology from the GoodRelations Vocabulary for E-Commerce, created by Martin Hepp. |
|
125 | + * GoodRelations is a data model for sharing e-commerce data on the Web. More information about |
|
126 | + * GoodRelations can be found at |
|
127 | + * [http://purl.org/goodrelations/](http://purl.org/goodrelations/). |
|
128 | + * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_GoodRelationsTerms |
|
129 | + */ |
|
130 | + const GoodRelationsTerms = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_GoodRelationsTerms'; |
|
131 | + |
|
132 | + /** |
|
133 | + * This element is based on work by the Web Applications for the Future Internet Lab, Institute |
|
134 | + * of Informatics and Telematics, Pisa, Italy. |
|
135 | + * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#IIT-CNR.it |
|
136 | + */ |
|
137 | + const IITCNRit = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#IIT-CNR.it'; |
|
138 | + |
|
139 | + /** |
|
140 | + * This class is based on the work of the LRMI project, see lrmi.net for details. |
|
141 | + * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_LRMIClass |
|
142 | + */ |
|
143 | + const LRMIClass = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_LRMIClass'; |
|
144 | + |
|
145 | + /** |
|
146 | + * This vocabulary was improved through collaboration with the MusicBrainz project |
|
147 | + * ([www.musicbrainz.org](http://www.musicbrainz.org)), and is partially inspired by the |
|
148 | + * MusicBrainz and |
|
149 | + * [Music Ontology](http://musicontology.com/docs/getting-started.html) schemas. |
|
150 | + * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#MBZ |
|
151 | + */ |
|
152 | + const MBZ = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#MBZ'; |
|
153 | + |
|
154 | + /** |
|
155 | + * This element is based on the STI Accommodation Ontology, see <a |
|
156 | + * href="http://ontologies.sti-innsbruck.at/acco/ns.html">http://ontologies.sti-innsbruck.at/acco/ns.html</a> |
|
157 | + * for details. |
|
158 | + * Many class and property definitions are inspired by or based on abstracts from Wikipedia, |
|
159 | + * the free encyclopedia. |
|
160 | + * @see https://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#STI_Accommodation_Ontology |
|
161 | + */ |
|
162 | + const STI_Accommodation_Ontology = 'https://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#STI_Accommodation_Ontology'; |
|
163 | + |
|
164 | + /** |
|
165 | + * The Question/Answer types were [based |
|
166 | + * on](https://www.w3.org/wiki/WebSchemas/QASchemaResearch) the Stack Overflow API. |
|
167 | + * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_QAStackExchange |
|
168 | + */ |
|
169 | + const Stack_Exchange = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_QAStackExchange'; |
|
170 | + |
|
171 | + /** |
|
172 | + * This term and associated definitions draws upon the work of [The Trust |
|
173 | + * Project](http://thetrustproject.org/). |
|
174 | + * @see https://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#TP-draws |
|
175 | + */ |
|
176 | + const The_Trust_Project = 'https://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#TP-draws'; |
|
177 | + |
|
178 | + /** |
|
179 | + * This element is based on the work of the [Tourism Structured Web Data Community |
|
180 | + * Group](https://www.w3.org/community/tourismdata). |
|
181 | + * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#Tourism |
|
182 | + */ |
|
183 | + const Tourism = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#Tourism'; |
|
184 | + |
|
185 | + /** |
|
186 | + * This class contains information contributed by |
|
187 | + * [http://wikidoc.org>WikiDoc](http://wikidoc.org>WikiDoc). |
|
188 | + * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_WikiDoc |
|
189 | + */ |
|
190 | + const WikiDoc = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_WikiDoc'; |
|
191 | + |
|
192 | + /** |
|
193 | + * This class contains derivatives of IPTC rNews properties. rNews is a data model of publishing |
|
194 | + * metadata with serializations currently available for RDFa as well as HTML5 Microdata. More |
|
195 | + * information about the IPTC and rNews can be found at [rnews.org](http://rnews.org). |
|
196 | + * @see http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_rNews |
|
197 | + */ |
|
198 | + const rNews = 'http://www.w3.org/wiki/WebSchemas/SchemaDotOrgSources#source_rNews'; |
|
199 | + |
|
200 | + /** |
|
201 | + * @var array |
|
202 | + * @see http://schema.org/{property_name} |
|
203 | + */ |
|
204 | + public $allowed = [ |
|
205 | + 'address', 'aggregateRating', 'areaServed', 'award', 'awards', 'brand', 'contactPoint', |
|
206 | + 'contactPoints', 'department', 'dissolutionDate', 'duns', 'email', 'employee', 'employees', |
|
207 | + 'event', 'events', 'faxNumber', 'founder', 'founders', 'foundingDate', 'foundingLocation', |
|
208 | + 'funder', 'globalLocationNumber', 'hasOfferCatalog', 'hasPOS', 'isicV4', 'legalName', |
|
209 | + 'leiCode', 'location', 'logo', 'makesOffer', 'member', 'memberOf', 'members', 'naics', |
|
210 | + 'numberOfEmployees', 'offeredBy', 'owns', 'parentOrganization', 'publishingPrinciples', |
|
211 | + 'review', 'reviews', 'seeks', 'serviceArea', 'sponsor', 'subOrganization', 'taxID', |
|
212 | + 'telephone', 'vatID', |
|
213 | + ]; |
|
214 | + |
|
215 | + /** |
|
216 | + * @var array |
|
217 | + * @see http://schema.org/{property_name} |
|
218 | + */ |
|
219 | + public $parents = [ |
|
220 | + 'Thing', |
|
221 | + ]; |
|
222 | 222 | } |
@@ -9,11 +9,11 @@ |
||
9 | 9 | */ |
10 | 10 | class Intangible extends BaseType |
11 | 11 | { |
12 | - /** |
|
13 | - * @var array |
|
14 | - * @see http://schema.org/{property_name} |
|
15 | - */ |
|
16 | - public $parents = [ |
|
17 | - 'Thing', |
|
18 | - ]; |
|
12 | + /** |
|
13 | + * @var array |
|
14 | + * @see http://schema.org/{property_name} |
|
15 | + */ |
|
16 | + public $parents = [ |
|
17 | + 'Thing', |
|
18 | + ]; |
|
19 | 19 | } |