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

Public Member Functions

 getID ()
 
 label ()
 
 setTitle ($title=NULL, $cache=[])
 
 getTitle ()
 
 setAlias ($path_alias=NULL)
 
 getType ()
 
 getCreatedTime ()
 
 setCreatedTime ($timestamp)
 
 getOwner ()
 
 getOwnerId ()
 
 setOwnerId ($uid)
 
 setOwner (UserInterface $account)
 
 isPublished ()
 
 setPublished ($published)
 
 preSave (EntityStorageInterface $storage)
 
 validate ()
 

Static Public Member Functions

static create (array $values=[])
 
static preCreate (EntityStorageInterface $storage_controller, array &$values)
 
static baseFieldDefinitions (EntityTypeInterface $entity_type)
 
static getValuesArray ($entity)
 
static postLoad (EntityStorageInterface $storage, array &$entities)
 

Detailed Description

Defines the Tripal Content entity.

@ContentEntityType( id = "tripal_entity", label = @Translation("Tripal Content"), bundle_label = @Translation("Tripal Content type"), handlers = { "storage" = "Drupal\Core\Entity\Sql\SqlContentEntityStorage", "view_builder" = "Drupal\Core\Entity\EntityViewBuilder", "list_builder" = "Drupal\tripal\ListBuilders\TripalEntityListBuilder", "views_data" = "Drupal\tripal\Entity\TripalEntityViewsData",

"form" = { "default" = "Drupal\tripal\Form\TripalEntityForm", "add" = "Drupal\tripal\Form\TripalEntityForm", "edit" = "Drupal\tripal\Form\TripalEntityForm", "delete" = "Drupal\tripal\Form\TripalEntityDeleteForm", }, "access" = "Drupal\tripal\Access\TripalEntityAccessControlHandler", "route_provider" = { "html" = "Drupal\tripal\Routing\TripalEntityHtmlRouteProvider", }, }, base_table = "tripal_entity", entity_keys = { "id" = "id", "bundle" = "type", "uid" = "user_id", "status" = "status", }, links = { "canonical" = "/bio_data/{tripal_entity}", "add-page" = "/bio_data/add", "add-form" = "/bio_data/add/{tripal_entity_type}", "edit-form" = "/bio_data/{tripal_entity}/edit", "delete-form" = "/bio_data/{tripal_entity}/delete", "collection" = "/admin/content/bio_data", }, bundle_entity_type = "tripal_entity_type", field_ui_base_route = "entity.tripal_entity_type.edit_form" )

Member Function Documentation

◆ baseFieldDefinitions()

static Drupal\tripal\Entity\TripalEntity::baseFieldDefinitions ( EntityTypeInterface  $entity_type)
static

{}

◆ create()

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

Constructs a new Tripal entity object, without permanently saving it.

$values = [
'title' => 'laceytest'.time(),
'type' => 'organism',
'uid' => 1,
];
$entity->save();
static create(array $values=[])
Definition: TripalEntity.php:88
Parameters
array$values
  • *title: the title of the entity.
  • *user_id: the user_id of the user who authored the content.
  • *type: the type of tripal entity this is (e.g. organism)
  • status: whether the entity is published or not (boolean)
  • created: the unix timestamp for when this content was created.
Returns
object The newly created entity.

◆ getCreatedTime()

Drupal\tripal\Entity\TripalEntity::getCreatedTime ( )

{Gets the Tripal Content creation timestamp.

Returns
int Creation timestamp of the Tripal Content.
}

Implements Drupal\tripal\Entity\TripalEntityInterface.

◆ getID()

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

{}

◆ getOwner()

Drupal\tripal\Entity\TripalEntity::getOwner ( )

{}

◆ getOwnerId()

Drupal\tripal\Entity\TripalEntity::getOwnerId ( )

{}

◆ getTitle()

Drupal\tripal\Entity\TripalEntity::getTitle ( )

{}

◆ getType()

Drupal\tripal\Entity\TripalEntity::getType ( )

{Gets the Tripal Content type.

Returns
string The Tripal Content type.
}

Implements Drupal\tripal\Entity\TripalEntityInterface.

◆ getValuesArray()

static Drupal\tripal\Entity\TripalEntity::getValuesArray (   $entity)
static

Returns an associative array of property type value for the entity.

The array is keyed in the following levels:

  • 1st: Tripal Stroage Plugin ID
  • 2nd: Field name
  • 3rd: Delta value of the field item.
  • 4th: the property key.
  • 5th: One of the following keys:
    • 'value': the property value object.
    • 'operation': the operation to use when matching this value.

This function also returns an array of TripalStorage objects.

Parameters
TripalEntity$entity
Returns
array The returned array has two elements: an array of values as described above, and an array of TripalStorage objects,

◆ isPublished()

Drupal\tripal\Entity\TripalEntity::isPublished ( )

{Returns the Tripal Content published status indicator.Unpublished Tripal Content are only visible to restricted users.

Returns
bool TRUE if the Tripal Content is published.
}

Implements Drupal\tripal\Entity\TripalEntityInterface.

◆ label()

Drupal\tripal\Entity\TripalEntity::label ( )

{}

◆ postLoad()

static Drupal\tripal\Entity\TripalEntity::postLoad ( EntityStorageInterface  $storage,
array &  $entities 
)
static

{}

◆ preCreate()

static Drupal\tripal\Entity\TripalEntity::preCreate ( EntityStorageInterface  $storage_controller,
array &  $values 
)
static

{}

◆ preSave()

Drupal\tripal\Entity\TripalEntity::preSave ( EntityStorageInterface  $storage)

{}

◆ setAlias()

Drupal\tripal\Entity\TripalEntity::setAlias (   $path_alias = NULL)

Sets the URL alias for the current entity.

Parameters
string$aliasThe alias to use. It can contain tokens the correspond to field values. Token should be be compatible with those returned by tripal_get_entity_tokens().

◆ setCreatedTime()

Drupal\tripal\Entity\TripalEntity::setCreatedTime (   $timestamp)

{Sets the Tripal Content creation timestamp.

Parameters
int$timestampThe Tripal Content creation timestamp.
Returns
\Drupal\tripal\Entity\TripalEntityInterface The called Tripal Content entity.
}

Implements Drupal\tripal\Entity\TripalEntityInterface.

◆ setOwner()

Drupal\tripal\Entity\TripalEntity::setOwner ( UserInterface  $account)

{}

◆ setOwnerId()

Drupal\tripal\Entity\TripalEntity::setOwnerId (   $uid)

{}

◆ setPublished()

Drupal\tripal\Entity\TripalEntity::setPublished (   $published)

{Sets the published status of a Tripal Content.

Parameters
bool$publishedTRUE to set this Tripal Content to published, FALSE to set it to unpublished.
Returns
\Drupal\tripal\Entity\TripalEntityInterface The called Tripal Content entity.
}

Implements Drupal\tripal\Entity\TripalEntityInterface.

◆ setTitle()

Drupal\tripal\Entity\TripalEntity::setTitle (   $title = NULL,
  $cache = [] 
)

{}

◆ validate()

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

{}


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