You are here

public function Type::testValue in Schema.org Metatag 8.2

Provide a test input value for the property that will validate.

Tags like @type that contain values other than simple strings, for instance a list of allowed options, should extend this method and return a valid value.

Parameters

mixed $type: The default to use for the @type element, if any.

Return value

mixed Return the test value, either a string or array, depending on the property.

Overrides PropertyTypeBase::testValue

File

src/Plugin/schema_metatag/PropertyType/Type.php, line 44

Class

Type
Provides a plugin for the '@type' Schema.org property type.

Namespace

Drupal\schema_metatag\Plugin\schema_metatag\PropertyType

Code

public function testValue($type = 'Organization') {
  return is_array($type) ? array_shift($type) : $type;
}