Tripal
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
Drupal\tripal\Services\TripalEntityTypeCollection Class Reference
Inheritance diagram for Drupal\tripal\Services\TripalEntityTypeCollection:
Inheritance graph
[legend]
Collaboration diagram for Drupal\tripal\Services\TripalEntityTypeCollection:
Collaboration graph
[legend]

Public Member Functions

 __construct (TripalIdSpaceManager $idSpaceManager, TripalVocabularyManager $vocabularyManager, TripalLogger $logger)
 
 getTypeCollections ()
 
 install (array $collection_ids)
 
 validate ($details)
 
 createContentType ($details)
 

Static Public Member Functions

static create (ContainerInterface $container)
 

Protected Attributes

 $idSpaceManager
 
 $vocabularyManager
 
 $logger
 

Constructor & Destructor Documentation

◆ __construct()

Drupal\tripal\Services\TripalEntityTypeCollection::__construct ( TripalIdSpaceManager  $idSpaceManager,
TripalVocabularyManager  $vocabularyManager,
TripalLogger  $logger 
)

Instantiates a new TripalEntityTypeCollection object.

Member Function Documentation

◆ create()

static Drupal\tripal\Services\TripalEntityTypeCollection::create ( ContainerInterface  $container)
static

{}

◆ createContentType()

Drupal\tripal\Services\TripalEntityTypeCollection::createContentType (   $details)

Creates the content type.

Parameters
array$detailsDescribes the content type you would like to create. Should contain the following:
  • label: the human-readable label to be used for the content type.
  • category: a human-readable category to group like content types together.
  • name: the machine-name of the content type.
  • help_text: a brief description for how this content type is used.
  • url_format: a tokenized string for specifying the format of the URL.
  • title_format: a tokenized string for the title.
  • term: a TripalTerm object that the content type is associated with.
  • id: the machine name of the content type.
  • synonms: (optional) a list of synonyms for this content type.
Returns
\Drupal\tripal\Entity\TripalEntityType

◆ getTypeCollections()

Drupal\tripal\Services\TripalEntityTypeCollection::getTypeCollections ( )

Retrieve a list of Tripal Entity Collections.

◆ install()

Drupal\tripal\Services\TripalEntityTypeCollection::install ( array  $collection_ids)

Installs content types using all appropriate YAML files.

Parameters
array$collection_idsAn array of the collection 'id' you would like to install.

◆ validate()

Drupal\tripal\Services\TripalEntityTypeCollection::validate (   $details)

Validates a Tripal content type definition array.

This function can be used to check a definition prior to adding the content type.

Parameters
array$detailsA definition array for the content type.
Returns
bool True if the array passes validation checks. False otherwise.

Member Data Documentation

◆ $idSpaceManager

Drupal tripal TripalVocabTerms PluginManagers TripalIdSpaceManager Drupal\tripal\Services\TripalEntityTypeCollection::$idSpaceManager
protected

The IdSpace service

◆ $logger

TripalLogger Drupal\tripal\Services\TripalEntityTypeCollection::$logger
protected

A logger object.

◆ $vocabularyManager

Drupal tripal TripalVocabTerms PluginManagers TripalVocabularyManager Drupal\tripal\Services\TripalEntityTypeCollection::$vocabularyManager
protected

The vocabulary service


The documentation for this class was generated from the following file: