class BundleSchema

Defines RDF terms corresponding to Drupal bundles.

Hierarchy

Expanded class hierarchy of BundleSchema

6 files declare their use of BundleSchema
RdfMappingEventTest.php in drupal/core/modules/rdf/lib/Drupal/rdf/Tests/RdfMappingEventTest.php
Contains RdfMappingEventTest.
RdfMappingManager.php in drupal/core/modules/rdf/lib/Drupal/rdf/RdfMappingManager.php
Contains RdfMappingManager.
SiteSchema.php in drupal/core/modules/rdf/lib/Drupal/rdf/SiteSchema/SiteSchema.php
Contains SiteSchema.
SiteSchemaManager.php in drupal/core/modules/rdf/lib/Drupal/rdf/SiteSchema/SiteSchemaManager.php
Contains SiteSchemaManager.
SiteSchemaTest.php in drupal/core/modules/rdf/lib/Drupal/rdf/Tests/SiteSchemaTest.php
Contains SiteSchemaTest.

... See full list

File

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

Namespace

Drupal\rdf\SiteSchema
View source
class BundleSchema extends EntitySchema {

  /**
   * The URI pattern for bundle site schema terms.
   *
   * @var string
   */
  public static $uriPattern = '{entity_type}/{bundle}';

  /**
   * The bundle that this term identifies.
   *
   * @var string
   */
  protected $bundle;

  /**
   * Constructor.
   *
   * @param \Drupal\rdf\SiteSchema\SiteSchema $site_schema
   *   The schema the term is defined in.
   * @param string $entity_type
   *   The entity type.
   * @param string $bundle
   *   The bundle.
   */
  public function __construct($site_schema, $entity_type, $bundle) {
    parent::__construct($site_schema, $entity_type);
    $this->bundle = $bundle;
  }

  /**
   * Implements \Drupal\rdf\SiteSchema\SchemaTermInterface::getUri().
   */
  public function getUri() {
    $path = str_replace(array(
      '{entity_type}',
      '{bundle}',
    ), array(
      $this->entityType,
      $this->bundle,
    ), static::$uriPattern);
    return $this->siteSchema
      ->getUri() . '/' . $path;
  }

  /**
   * Overrides \Drupal\rdf\SiteSchema\SchemaTermBase::getProperties().
   */
  public function getProperties() {
    $properties = parent::getProperties();
    $properties[RdfConstants::RDFS_SUB_CLASS_OF] = $this->siteSchema
      ->entity($this->entityType)
      ->getUri();
    return $properties;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BundleSchema::$bundle protected property The bundle that this term identifies.
BundleSchema::$uriPattern public static property The URI pattern for bundle site schema terms. Overrides EntitySchema::$uriPattern
BundleSchema::getProperties public function Overrides \Drupal\rdf\SiteSchema\SchemaTermBase::getProperties(). Overrides EntitySchema::getProperties
BundleSchema::getUri public function Implements \Drupal\rdf\SiteSchema\SchemaTermInterface::getUri(). Overrides EntitySchema::getUri
BundleSchema::__construct public function Constructor. Overrides EntitySchema::__construct
EntitySchema::$entityType protected property The entity type that this term identifies.
EntitySchema::getGraph public function Implements \Drupal\rdf\SiteSchema\SchemaTermInterface::getGraph(). Overrides SchemaTermInterface::getGraph
SchemaTermBase::$siteSchema protected property The schema in which this term is defined.