aggregateRating??null; } public function setAggregateRating(array|AggregateRating $aggregateRating):void { if (is_array($aggregateRating)){ if (!array_key_exists('type', $aggregateRating)) { $aggregateRating['type'] = 'JVBase\managers\SEO\render\Thing\Intangible\Rating\AggregateRating'; } $aggregateRating = SchemaHelper::classFromConfig($aggregateRating); } $this->aggregateRating = $aggregateRating; } public function getAggregateRatingFieldConfig():array { return [ 'type' => 'group', 'label' => 'Aggregate/Average Rating', 'wrap' => 'details', 'fields' => [ 'ratingCount' => [ 'type' => 'number', 'label' => 'The total number of ratings (without text)', ], 'reviewCount' => [ 'type' => 'number', 'label' => 'The total number of reviews (with text)' ], 'bestRating' => [ 'type' => 'number', 'label' => 'The best rating', 'default'=> 5, ], 'worstRating' => [ 'type' => 'number', 'label' => 'The worst rating', 'default'=> 1, ] ] ]; } }