Open Data Catalog v2.0.0
Drupal\metastore\NodeWrapper\NodeDataFactory Class Reference
Inheritance diagram for Drupal\metastore\NodeWrapper\NodeDataFactory:
Drupal\metastore\Factory\MetastoreEntityItemFactoryInterface Drupal\metastore\Factory\MetastoreItemFactoryInterface

Public Member Functions

 __construct (EntityRepository $entityRepository)
 
 getInstance (string $identifier, array $config=[])
 
 wrap ($dataNode)
 

Static Public Member Functions

static getEntityType ()
 
static getBundles ()
 
static getCacheTags ()
 
static getMetadataField ()
 

Detailed Description

Class NodeDataFactory.

Build a MetastoreItemInterface object from a simple node.

Definition at line 13 of file NodeDataFactory.php.

Constructor & Destructor Documentation

◆ __construct()

Drupal\metastore\NodeWrapper\NodeDataFactory::__construct ( EntityRepository  $entityRepository)

Constructor.

Parameters
\Drupal\Core\Entity\EntityRepository$entityRepositoryThe entity repository service.

Implements Drupal\metastore\Factory\MetastoreItemFactoryInterface.

Definition at line 28 of file NodeDataFactory.php.

Member Function Documentation

◆ getBundles()

static Drupal\metastore\NodeWrapper\NodeDataFactory::getBundles ( )
static

{Get the bundles, if any, used by this factory for storing item entities.

Returns
array Array of bundle IDs.
}

Implements Drupal\metastore\Factory\MetastoreEntityItemFactoryInterface.

Definition at line 71 of file NodeDataFactory.php.

◆ getCacheTags()

static Drupal\metastore\NodeWrapper\NodeDataFactory::getCacheTags ( )
static

{Return list cache tags for metastore items.

Returns
array An array of cache tags.
Todo:
Make this schema-specific.
}

Implements Drupal\metastore\Factory\MetastoreItemFactoryInterface.

Definition at line 78 of file NodeDataFactory.php.

◆ getEntityType()

static Drupal\metastore\NodeWrapper\NodeDataFactory::getEntityType ( )
static

{Get the entity type used for this item factory.

Returns
string The entity type ID, e.g. 'node'.
}

Implements Drupal\metastore\Factory\MetastoreEntityItemFactoryInterface.

Definition at line 64 of file NodeDataFactory.php.

◆ getInstance()

Drupal\metastore\NodeWrapper\NodeDataFactory::getInstance ( string  $identifier,
array  $config = [] 
)

Get a metastore node data object from an identifier.

Parameters
string$identifierNode uuid.
array$configOptional config from interface, not used.
Returns
Data Metastore data node object.

Implements Drupal\metastore\Factory\MetastoreItemFactoryInterface.

Definition at line 43 of file NodeDataFactory.php.

◆ getMetadataField()

static Drupal\metastore\NodeWrapper\NodeDataFactory::getMetadataField ( )
static

{Get the name of the entity field or property used to store metadata.

Returns
string Field API name.
}

Implements Drupal\metastore\Factory\MetastoreEntityItemFactoryInterface.

Definition at line 85 of file NodeDataFactory.php.

◆ wrap()

Drupal\metastore\NodeWrapper\NodeDataFactory::wrap (   $dataNode)

Create a metastore node data object from a node object.

Parameters
mixed$dataNodeA data node.
Returns
Data Metastore data node object.

Implements Drupal\metastore\Factory\MetastoreItemFactoryInterface.

Definition at line 57 of file NodeDataFactory.php.