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

Public Member Functions

 save ()
 
 validate ()
 
 setDefaults ()
 
 id ()
 
 getID ()
 
 getLabel ()
 
 setLabel ($label)
 
 getTermIdSpace ()
 
 setTermIdSpace ($termIdSpace)
 
 getTermAccession ()
 
 setTermAccession ($termAccession)
 
 getTerm ()
 
 setTerm (TripalTerm $term)
 
 getHelpText ()
 
 setHelpText ($help_text)
 
 getCategory ()
 
 setCategory ($category)
 
 getTitleFormat ()
 
 setTitleFormat ($title_format)
 
 getDefaultTitleFormat ()
 
 getURLFormat ()
 
 setURLFormat ($url_format)
 
 getTokens ($options=[])
 
 hideEmptyFields ()
 
 showEmptyFields ()
 
 getEmptyFieldDisplay ()
 
 enableAJAXLoading ()
 
 disableAJAXLoading ()
 
 getAJAXLoadingStatus ()
 

Static Public Member Functions

static create (array $values=[])
 
static sortByCategory (TripalEntityTypeInterface $a, TripalEntityTypeInterface $b)
 

Protected Attributes

 $id
 
 $label
 
 $termIdSpace
 
 $termAccession
 
 $help_text
 
 $category
 
 $title_format
 
 $url_format
 
 $hide_empty_field
 
 $ajax_field
 

Detailed Description

Defines the Tripal Content type entity.

@ConfigEntityType( id = "tripal_entity_type", label = @Translation("Tripal Content Type"), label_collection = @Translation("Tripal Content Types"), label_singular = @Translation("Tripal content type"), label_plural = @Translation("Tripal content types"), label_count = @PluralTranslation( singular = "@count Tripal content type", plural = "@count Tripal content types", ), handlers = { "list_builder" = "Drupal\tripal\ListBuilders\TripalEntityTypeListBuilder", "form" = { "add" = "Drupal\tripal\Form\TripalEntityTypeForm", "edit" = "Drupal\tripal\Form\TripalEntityTypeForm", "delete" = "Drupal\tripal\Form\TripalEntityTypeDeleteForm" }, "route_provider" = { "html" = "Drupal\tripal\Routing\TripalEntityTypeHtmlRouteProvider", }, }, config_prefix = "content_type", admin_permission = "manage tripal content types", bundle_of = "tripal_entity", entity_keys = { "id" = "id", "label" = "label", }, links = { "canonical" = "/admin/structure/bio_data/{tripal_entity_type}", "add-form" = "/admin/structure/bio_data/add", "edit-form" = "/admin/structure/bio_data/manage/{tripal_entity_type}", "delete-form" = "/admin/structure/bio_data/manage/{tripal_entity_type}/delete", "collection" = "/admin/structure/bio_data" }, config_export = { "id", "label", "termIdSpace", "termAccession", "help_text", "category", "title_format", "url_format", "hide_empty_field", "ajax_field" } )

Member Function Documentation

◆ create()

static Drupal\tripal\Entity\TripalEntityType::create ( array  $values = [])
static

Contructs a new TripalEntityType object without permanently saving it.

Extends EntityBase::create() with support for TripalTerm as a value.

Parameters
array$valuesAn array of values to set, keyed by property name. Supported keys are:
Returns
TripalEntityType An TripalEntityType with the values passed in set appropriately.

◆ disableAJAXLoading()

Drupal\tripal\Entity\TripalEntityType::disableAJAXLoading ( )

{Configures the entity such that fields will be loaded on page load.}

Implements Drupal\tripal\Entity\TripalEntityTypeInterface.

◆ enableAJAXLoading()

Drupal\tripal\Entity\TripalEntityType::enableAJAXLoading ( )

{Configures the entity such that fields will be loaded via AJAX after page load.}

Implements Drupal\tripal\Entity\TripalEntityTypeInterface.

◆ getAJAXLoadingStatus()

Drupal\tripal\Entity\TripalEntityType::getAJAXLoadingStatus ( )

{Retrieves the indicator for whether to load fields using AJAX or not.

Returns
true if AJAX should be used to load fields and false otherwise.
}

Implements Drupal\tripal\Entity\TripalEntityTypeInterface.

◆ getCategory()

Drupal\tripal\Entity\TripalEntityType::getCategory ( )

{Gets the category for this Tripal Entity Type.

Returns
string Category for the Tripal Entity Type.
}

Implements Drupal\tripal\Entity\TripalEntityTypeInterface.

◆ getDefaultTitleFormat()

Drupal\tripal\Entity\TripalEntityType::getDefaultTitleFormat ( )

{}

Todo:
add to docs

◆ getEmptyFieldDisplay()

Drupal\tripal\Entity\TripalEntityType::getEmptyFieldDisplay ( )

{Retrieves the indicator for whether to hide empty fields or not.

Returns
true if empty fields should be hidden and false otherwise.
}

Implements Drupal\tripal\Entity\TripalEntityTypeInterface.

◆ getHelpText()

Drupal\tripal\Entity\TripalEntityType::getHelpText ( )

{Gets help text for admin for this Tripal Entity Type.

Returns
string Help text for the Tripal Entity Type.
}

Implements Drupal\tripal\Entity\TripalEntityTypeInterface.

◆ getID()

Drupal\tripal\Entity\TripalEntityType::getID ( )

{}

◆ getLabel()

Drupal\tripal\Entity\TripalEntityType::getLabel ( )

{Gets the Tripal Entity Type label (e.g. gene).

Returns
string Label of the Tripal Entity Type.
}

Implements Drupal\tripal\Entity\TripalEntityTypeInterface.

◆ getTerm()

Drupal\tripal\Entity\TripalEntityType::getTerm ( )

{Gets the Tripal Entity Type CV Term Object based off its CV Term ID Space and Accession.

Returns
\Drupal\tripal\TripalVocabTerms\TripalTerm The Tripal Controlled Vocabulary Term Object.
}

Implements Drupal\tripal\Entity\TripalEntityTypeInterface.

◆ getTermAccession()

Drupal\tripal\Entity\TripalEntityType::getTermAccession ( )

{Gets the Tripal Entity Type CV Term Accession.

Returns
string The Tripal Controlled Vocabulary Term Accession.
}

Implements Drupal\tripal\Entity\TripalEntityTypeInterface.

◆ getTermIdSpace()

Drupal\tripal\Entity\TripalEntityType::getTermIdSpace ( )

{Gets the Tripal Entity Type CV Term ID Space.

Returns
string The Tripal Controlled Vocabulary Term ID Space.
}

Implements Drupal\tripal\Entity\TripalEntityTypeInterface.

◆ getTitleFormat()

Drupal\tripal\Entity\TripalEntityType::getTitleFormat ( )

{Gets the title format for this Tripal Entity Type.

Returns
string Title format for the Tripal Entity Type.
}

Implements Drupal\tripal\Entity\TripalEntityTypeInterface.

◆ getTokens()

Drupal\tripal\Entity\TripalEntityType::getTokens (   $options = [])

{}

Todo:
add to docs.

◆ getURLFormat()

Drupal\tripal\Entity\TripalEntityType::getURLFormat ( )

{Gets the URL format for this Tripal Entity Type.

Returns
string URL format for the Tripal Entity Type.
}

Implements Drupal\tripal\Entity\TripalEntityTypeInterface.

◆ hideEmptyFields()

Drupal\tripal\Entity\TripalEntityType::hideEmptyFields ( )

{Configures the entity such that empty fields will be hidden.}

Implements Drupal\tripal\Entity\TripalEntityTypeInterface.

◆ id()

Drupal\tripal\Entity\TripalEntityType::id ( )

{}

◆ save()

Drupal\tripal\Entity\TripalEntityType::save ( )

Saves the new TripalEntityType permanently.

Extends ConfigEntityBase::save() with support for creating the associated TripalTerm if it doesn't already exist.

When saving existing entities, the entity is assumed to be complete, partial updates of entities are not supported.

Returns
int Either SAVED_NEW or SAVED_UPDATED, depending on the operation performed.

◆ setCategory()

Drupal\tripal\Entity\TripalEntityType::setCategory (   $category)

{Sets the Tripal Entity Type category.

Parameters
string$categoryThe Tripal Entity Type category.
Returns
\Drupal\tripal\Entity\TripalEntityTypeInterface The called Tripal Entity Type entity.
}

Implements Drupal\tripal\Entity\TripalEntityTypeInterface.

◆ setDefaults()

Drupal\tripal\Entity\TripalEntityType::setDefaults ( )

Set defaults of values which are not yet set.

◆ setHelpText()

Drupal\tripal\Entity\TripalEntityType::setHelpText (   $help_text)

{Sets the Tripal Entity Type help text.

Parameters
string$help_textThe Tripal Entity Type help text.
Returns
\Drupal\tripal\Entity\TripalEntityTypeInterface The called Tripal Entity Type entity.
}

Implements Drupal\tripal\Entity\TripalEntityTypeInterface.

◆ setLabel()

Drupal\tripal\Entity\TripalEntityType::setLabel (   $label)

{Sets the Tripal Entity Type label (e.g. gene).

Parameters
string$labelThe Tripal Entity Type label.
Returns
\Drupal\tripal\Entity\TripalEntityTypeInterface The called Tripal Entity Type entity.
}

Implements Drupal\tripal\Entity\TripalEntityTypeInterface.

◆ setTerm()

Drupal\tripal\Entity\TripalEntityType::setTerm ( TripalTerm  $term)

{}

◆ setTermAccession()

Drupal\tripal\Entity\TripalEntityType::setTermAccession (   $termAccession)

{Sets the Tripal Entity Type CV Term Accession.

Parameters
string$termIdSpaceThe new Tripal Controlled Vocabulary Term Accession
Returns
\Drupal\tripal\Entity\TripalEntityTypeInterface The called Tripal Entity Type entity.
}

Implements Drupal\tripal\Entity\TripalEntityTypeInterface.

◆ setTermIdSpace()

Drupal\tripal\Entity\TripalEntityType::setTermIdSpace (   $termIdSpace)

{Sets the Tripal Entity Type CV Term ID Space.

Parameters
string$termIdSpaceThe new Tripal Controlled Vocabulary Term ID Space
Returns
\Drupal\tripal\Entity\TripalEntityTypeInterface The called Tripal Entity Type entity.
}

Implements Drupal\tripal\Entity\TripalEntityTypeInterface.

◆ setTitleFormat()

Drupal\tripal\Entity\TripalEntityType::setTitleFormat (   $title_format)

{Sets the Tripal Entity Type title format.

Parameters
string$title_formatThe Tripal Entity Type title format.
Returns
\Drupal\tripal\Entity\TripalEntityTypeInterface The called Tripal Entity Type entity.
}

Implements Drupal\tripal\Entity\TripalEntityTypeInterface.

◆ setURLFormat()

Drupal\tripal\Entity\TripalEntityType::setURLFormat (   $url_format)

{Sets the Tripal Entity Type URL format.

Parameters
string$url_formatThe Tripal Entity Type URL format.
Returns
\Drupal\tripal\Entity\TripalEntityTypeInterface The called Tripal Entity Type entity.
}

Implements Drupal\tripal\Entity\TripalEntityTypeInterface.

◆ showEmptyFields()

Drupal\tripal\Entity\TripalEntityType::showEmptyFields ( )

{Configures the entity such that empty fields will be shown.}

Implements Drupal\tripal\Entity\TripalEntityTypeInterface.

◆ sortByCategory()

static Drupal\tripal\Entity\TripalEntityType::sortByCategory ( TripalEntityTypeInterface  $a,
TripalEntityTypeInterface  $b 
)
static

Sorts Tripal Entity Types first by category and then by Label.

Parameters
$aThe first Tripal Entity Type object.
$bThe second Tripal Entity Type object.

◆ validate()

Drupal\tripal\Entity\TripalEntityType::validate ( )

Validate the expected values before saving.

Note: This function throws exceptions so make sure to catch them ;-p We do not want users seeing a WSOD.


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