class SchemaMetatagClient in Schema.org Metatag 8.2
Same name in this branch
- 8.2 src/SchemaMetatagClient.php \Drupal\schema_metatag\SchemaMetatagClient
- 8.2 tests/modules/schema_metatag_test/src/SchemaMetatagClient.php \Drupal\schema_metatag_test\SchemaMetatagClient
Class SchemaMetatagClient.
A class to parse Schema.org data.
@package Drupal\schema_metatag
Hierarchy
- class \Drupal\schema_metatag\SchemaMetatagClient implements SchemaMetatagClientInterface
- class \Drupal\schema_metatag_test\SchemaMetatagClient
Expanded class hierarchy of SchemaMetatagClient
File
- tests/
modules/ schema_metatag_test/ src/ SchemaMetatagClient.php, line 14
Namespace
Drupal\schema_metatag_testView source
class SchemaMetatagClient extends SchemaMetatagClientOriginal {
/**
* {@inheritdoc}
*/
public function getLocalFile() {
return '';
}
/**
* {@inheritdoc}
*/
public function getObjects($clear = FALSE) {
return [];
}
/**
* {@inheritdoc}
*/
public function getProperties($clear = FALSE) {
return [];
}
/**
* {@inheritdoc}
*/
public function getObjectTree($clear = FALSE, $clear_objects = FALSE) {
// Provide a tree that contains all objects used in tests, organized into
// their actual hierarchy.
return [
'Thing' => [
'Action' => [
'ConsumeAction' => [
'ReadAction' => [],
'ViewAction' => [],
'WatchAction' => [],
],
'TradeAction' => [
'BuyAction' => [],
'OrderAction' => [],
],
'OrganizeAction' => [
'PlanAction' => [
'ReserveAction' => [],
],
],
'SearchAction' => [],
],
'CreativeWork' => [
'Article' => [],
'Book' => [],
'Clip' => [],
'Comment' => [
'Answer' => [],
],
'Course' => [],
'CreativeWorkSeason' => [],
'MediaObject' => [
'ImageObject' => [],
'VideoObject' => [],
],
'Movie' => [],
'HowTo' => [
'Recipe' => [],
],
'HowToStep' => [],
'Question' => [],
'Review' => [],
'SpecialAnnouncement' => [],
'WebPage' => [
'QAPage' => [],
'FAQPage' => [],
],
'WebPageElement' => [],
'WebSite' => [],
],
'DataType' => [
'Boolean' => [],
'Date' => [],
'DateTime' => [],
'Number' => [],
'Text' => [
'URL' => [],
],
'Time' => [],
],
'Event' => [
'PublicationEvent' => [],
],
'Intangible' => [
'Brand' => [],
'ContactPoint' => [
'PostalAddress' => [],
],
'EntryPoint' => [],
'ItemList' => [
'BreadcrumbList' => [],
],
'JobPosting' => [],
'Offer' => [],
'ProgramMembership' => [],
'Quantity' => [
'Duration' => [],
'Mass' => [],
],
'Rating' => [
'AggregateRating' => [],
],
'Series' => [
'CreativeWorkSeries' => [],
],
'Service' => [
'GovernmentService' => [],
],
'SpeakableSpecification' => [],
'StructuredValue' => [
'ContactPoint' => [],
'GeoCoordinates' => [],
'MonetaryAmount' => [],
'NutritionInformation' => [],
'OpeningHoursSpecification' => [],
'QuantitativeValue' => [],
],
],
'Organization' => [
'GovernmentOrganization' => [],
'LocalBusiness' => [
'FoodEstablishment' => [
'Restaurant' => [],
],
'GovernmentOffice' => [],
],
],
'Person' => [],
'Place' => [
'AdministrativeArea' => [
'Country' => [],
],
],
'Product' => [],
],
];
}
/**
* {@inheritdoc}
*/
public function getTree($parent_name = NULL, $depth = -1, $clear = FALSE, $clear_tree = FALSE, $clear_objects = FALSE) {
// Override the original method to skip caching and use our test tree.
$base_tree = $this
->getObjectTree();
return $this
->getUncachedTree($base_tree, $parent_name, $depth);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SchemaMetatagClient:: |
protected | property | The cache backend service. | |
SchemaMetatagClient:: |
protected | property | Module handler. | |
SchemaMetatagClient:: |
protected static | property | The object prefix used in the provided Schema.org data. | |
SchemaMetatagClient:: |
protected static | property | The scheme used in the provided Schema.org data. | |
SchemaMetatagClient:: |
public | function |
Clears all data from the cache. Overrides SchemaMetatagClientInterface:: |
|
SchemaMetatagClient:: |
public static | function | ||
SchemaMetatagClient:: |
public | function |
Retrieve and decode data from a local schema.jsonld file. Overrides SchemaMetatagClient:: |
|
SchemaMetatagClient:: |
public | function | ||
SchemaMetatagClient:: |
public | function |
Reorganize the classes into a hierarchical tree. Overrides SchemaMetatagClient:: |
|
SchemaMetatagClient:: |
public | function |
Create a @type option list from a given tree section. Overrides SchemaMetatagClientInterface:: |
|
SchemaMetatagClient:: |
public | function |
Get an array of all parents of a given class. Overrides SchemaMetatagClientInterface:: |
|
SchemaMetatagClient:: |
public | function | ||
SchemaMetatagClient:: |
public | function |
Get some or all of the object tree. Overrides SchemaMetatagClient:: |
|
SchemaMetatagClient:: |
public | function |
Get some or all of the object tree. Overrides SchemaMetatagClientInterface:: |
|
SchemaMetatagClient:: |
public | function |
Detect if this is a Schema.org class we care about. Overrides SchemaMetatagClientInterface:: |
|
SchemaMetatagClient:: |
public | function |
Detect if this is a Schema.org property we care about. Overrides SchemaMetatagClientInterface:: |
|
SchemaMetatagClient:: |
public | function |
Retrieve an array of object information from the raw data. Overrides SchemaMetatagClientInterface:: |
|
SchemaMetatagClient:: |
public | function |
Retrieve object properties. Overrides SchemaMetatagClientInterface:: |
|
SchemaMetatagClient:: |
public | function |
Sort a nested associative array. Overrides SchemaMetatagClientInterface:: |
|
SchemaMetatagClient:: |
public | function | Construct a Schema client object. |