Tripal
|
Public Member Functions | |
__construct (TripalIdSpaceManager $idSpaceManager, TripalVocabularyManager $vocabularyManager, TripalLogger $logger) | |
setFieldDefDefaults (array $field_def=[]) | |
validate ($field_def) | |
install (array $collection_ids) | |
addBundleField ($field_def) | |
Static Public Member Functions | |
static | create (ContainerInterface $container) |
Protected Attributes | |
$idSpaceManager | |
$vocabularyManager | |
$logger | |
Provides an tripalStorage plugin manager.
Drupal\tripal\Services\TripalFieldCollection::__construct | ( | TripalIdSpaceManager | $idSpaceManager, |
TripalVocabularyManager | $vocabularyManager, | ||
TripalLogger | $logger | ||
) |
Constructor
Drupal\tripal\Services\TripalFieldCollection::addBundleField | ( | $field_def | ) |
Adds a field to a Tripal entity type.
string | $bundle | The bundle name (e.g. organism). |
array | $field_def | An associative array providing the necessary information about a field instance for this entity type. The following key/values are supported
|
An example field defintion:
|
static |
{}
Drupal\tripal\Services\TripalFieldCollection::install | ( | array | $collection_ids | ) |
Attaches fields to Tripal content types.
array | $collection_ids | An array of the collection 'id' you would like to install. |
Drupal\tripal\Services\TripalFieldCollection::setFieldDefDefaults | ( | array | $field_def = [] | ) |
Adds default values for keys in the field definition array.
This function will only add defaults if the value is not already present in the $field_def array. You can retrieve a fully populated definition array, with defaults, by not passing an argument. This function will remove any keys in the definition array that are not supported.
Drupal\tripal\Services\TripalFieldCollection::validate | ( | $field_def | ) |
Validates a field definition array.
This function can be used to check a field definition prior to adding the field to a Tripal content type.
array | $field_def | A definition array for the field. |
|
protected |
The IdSpace service
|
protected |
A logger object.
|
protected |
The vocabulary service