additionalProperty??null; } public function setAdditionalProperty(PropertyValue|array $additionalProperty):void { if (is_array($additionalProperty)) { if (!is_numeric(array_key_first($additionalProperty))) { $additionalProperty = [$additionalProperty]; } $additionalProperty = array_map(function($property) { if (!array_key_exists('type', $property)) { $property['type'] = 'JVBase\managers\SEO\render\Thing\Intangible\StructuredValue\PropertyValue'; } return $property; }, $additionalProperty); $additionalProperty = $this->classArray('additionalProperty', $additionalProperty, 'JVBase\managers\SEO\render\Thing\Intangible\StructuredValue\PropertyValue'); $additionalProperty = array_filter($additionalProperty, function ($property) { return property_exists($property, 'value') && !empty($property->value); }); } if (!empty($this->additionalProperty)) { if (!is_array($this->additionalProperty)) { $this->additionalProperty = [$this->additionalProperty]; } $additionalProperty = array_merge($this->additionalProperty, $additionalProperty); } $this->additionalProperty = $additionalProperty; } public function getAdditionalPropertyFieldConfig():array { return [ 'type' => 'repeater', 'label' => 'Additional Properties', 'hint' => 'If you need to define another property that does not exist anywhere on this page, add it here.', 'fields' => [ 'name' => [ 'type' => 'text', 'label' => 'Name' ], 'propertyID' => [ 'type' => 'text', 'label' => 'Property ID', 'hint' => 'A commonly used identifier for the characteristic represented by the property, e.g. a manufacturer or a standard code for a property. propertyID can be (1) a prefixed string, mainly meant to be used with standards for product properties; (2) a site-specific, non-prefixed string (e.g. the primary key of the property or the vendor-specific ID of the property), or (3) a URL indicating the type of the property, either pointing to an external vocabulary, or a Web resource that describes the property (e.g. a glossary entry). Standards bodies should promote a standard prefix for the identifiers of properties from their standards.' ], 'value' => [ 'type' => 'textarea', 'label' => 'Value' ] ] ]; } }