public function SiteSchema::__construct

Constructor.

Parameters

string $schema_path: The schema path constant, used to determine which schema to instantiate.

Throws

\UnexpectedValueException

File

drupal/core/modules/rdf/lib/Drupal/rdf/SiteSchema/SiteSchema.php, line 40
Contains SiteSchema.

Class

SiteSchema
Defines a site-generated schema.

Namespace

Drupal\rdf\SiteSchema

Code

public function __construct($schema_path) {
  $valid_paths = array(
    self::CONTENT_DEPLOYMENT,
    self::SYNDICATION,
  );
  if (!in_array($schema_path, $valid_paths)) {
    throw new \UnexpectedValueException(sprintf('%s is not a valid site schema path. Schema path must be one of %s.'), $schema_path, implode(', ', $valid_paths));
  }
  $this->schemaPath = $schema_path;
}