You are here

interface SchemaInterface in Schemata 8

Requirements for a Schema to interact with Schema utilities and serializers.

A schema is not directly usable on it's own, it is expected a serializer implemented to process an instance of SchemaInterface will produce a schema to a particular standard, such as JSON-Schema.

At present, this interface is only useful for modules that largely sidestep the Schemata module but still choose to leverage Schema-centric serializers.

Hierarchy

Expanded class hierarchy of SchemaInterface

All classes that implement SchemaInterface

3 files declare their use of SchemaInterface
SchemaFactoryTest.php in tests/src/Kernel/SchemaFactoryTest.php
SchemataSchemaNormalizer.php in schemata_json_schema/src/Normalizer/jsonapi/SchemataSchemaNormalizer.php
SchemataSchemaNormalizer.php in schemata_json_schema/src/Normalizer/json/SchemataSchemaNormalizer.php

File

src/Schema/SchemaInterface.php, line 15

Namespace

Drupal\schemata\Schema
View source
interface SchemaInterface {

  /**
   * Add additional data properties to the Schema.
   *
   * @param \Drupal\Core\TypedData\DataDefinitionInterface[] $properties
   *   The property data definitions.
   */
  public function addProperties(array $properties);

  /**
   * Retrieve the Entity Type ID.
   *
   * @return string
   *   The Entity Type ID
   */
  public function getEntityTypeId();

  /**
   * Retrieve the Bundle ID.
   *
   * @return string
   *   The Bundle ID
   */
  public function getBundleId();

  /**
   * Retrieve the Schema properties.
   *
   * @return \Drupal\Core\TypedData\DataDefinitionInterface[]
   *   The property data definitions.
   */
  public function getProperties();

  /**
   * Retrieve the Schema metadata.
   *
   * @return string[]
   *   The metadata values.
   */
  public function getMetadata();

}

Members

Namesort descending Modifiers Type Description Overrides
SchemaInterface::addProperties public function Add additional data properties to the Schema. 1
SchemaInterface::getBundleId public function Retrieve the Bundle ID. 1
SchemaInterface::getEntityTypeId public function Retrieve the Entity Type ID. 1
SchemaInterface::getMetadata public function Retrieve the Schema metadata. 1
SchemaInterface::getProperties public function Retrieve the Schema properties. 1