|
| setInterval ($interval) |
|
| addItemsHandled ($num_handled) |
|
| setTotalItems ($total_items) |
|
| setItemsHandled ($total_handled) |
|
| addRequiredValues (&$search_values) |
|
| getEntityTitles ($matches) |
|
| findEntities ($matches, $titles) |
|
| insertEntities ($matches, $titles) |
|
| findFieldItems ($field_name, $entities) |
|
| countFieldMatches (string $field_name, array $matches) |
|
| insertFieldItems ($field_name, $matches, $titles, $entities, $existing) |
|
| excludeExisting ($matches, $titles, $existing) |
|
◆ addItemsHandled()
Drupal\tripal\Services\TripalPublish::addItemsHandled |
( |
|
$num_handled | ) |
|
|
protected |
Adds to the count of the total number of items that have been handled.
- Parameters
-
◆ addRequiredValues()
Drupal\tripal\Services\TripalPublish::addRequiredValues |
( |
& |
$search_values | ) |
|
|
protected |
Adds to the search values array the required proprty values.
- Parameters
-
◆ countFieldMatches()
Drupal\tripal\Services\TripalPublish::countFieldMatches |
( |
string |
$field_name, |
|
|
array |
$matches |
|
) |
| |
|
protected |
Counts the total items to insert for a field.
The matches array returned by the TripalStorage is orgnized by entity but fields can have a cardinality > 1. This function counts the number of items for the given field.
- Parameters
-
string | $field_name | The name of the field |
array | $matches | The array of matches for each entity. |
- Returns
- int The number of items for the field
◆ excludeExisting()
Drupal\tripal\Services\TripalPublish::excludeExisting |
( |
|
$matches, |
|
|
|
$titles, |
|
|
|
$existing |
|
) |
| |
|
protected |
Removes existing records from the set of matched records.
- Parameters
-
array | $matches | The array of matches for each entity. |
array | $titles | The array of entity titles in the same order as the matches. |
array | $existing | The array of existing records. |
- Returns
- array A new array of two elements: the matches and titles arrays but with existing records excluded.
◆ findEntities()
Drupal\tripal\Services\TripalPublish::findEntities |
( |
|
$matches, |
|
|
|
$titles |
|
) |
| |
|
protected |
Makes sure that we will not be adding any dupliate entities.
- Parameters
-
array | $matches | The array of matches for each entity. |
array | $titles | The array of entity titles in the same order as the matches. |
- Returns
- array An associative array of matched entities keyed by the entity title with a value of the entity id.
◆ findFieldItems()
Drupal\tripal\Services\TripalPublish::findFieldItems |
( |
|
$field_name, |
|
|
|
$entities |
|
) |
| |
|
protected |
Makes sure that we will not be adding any dupliate entities.
- Parameters
-
string | $field_name | The name of the field |
array | $entities | An associative array of entities |
- Returns
- array An associative array of matched entities keyed by the entity_id with a value of the entity id. This is an associative array to take advantage of quick lookups.
◆ getEntityTitles()
Drupal\tripal\Services\TripalPublish::getEntityTitles |
( |
|
$matches | ) |
|
|
protected |
Retrieves a list of titles for the entities that should be published.
- Parameters
-
array | $matches | The array of matches for each entity. |
- Returns
- array A list of titles in order of the entities provided by the $matches array.
◆ insertEntities()
Drupal\tripal\Services\TripalPublish::insertEntities |
( |
|
$matches, |
|
|
|
$titles |
|
) |
| |
|
protected |
Performs bulk insert of new entities into the tripal_entity table
- Parameters
-
array | $matches | The array of matches for each entity. |
array | $titles | The array of entity titles in the same order as the matches. |
◆ insertFieldItems()
Drupal\tripal\Services\TripalPublish::insertFieldItems |
( |
|
$field_name, |
|
|
|
$matches, |
|
|
|
$titles, |
|
|
|
$entities, |
|
|
|
$existing |
|
) |
| |
|
protected |
Inserts records into the field tables for entities.
- Parameters
-
string | $field_name | The name of the field |
array | $matches | The array of matches for each entity. |
array | $titles | The array of entity titles in the same order as the matches. |
array | $entities | An associative array that maps entity titles to their keys. |
array | $existing | An associative array of entities that already have an existing item for this field. |
◆ publish()
Drupal\tripal\Services\TripalPublish::publish |
( |
|
$filters = [] | ) |
|
Publishes Tripal entities.
Publishes content to Tripal from Chado or another specified datastore that matches the provided filters.
- Parameters
-
array | $filters | Filters that determine which content will be published. |
- Returns
- array An associative array of the entities that were published, keyed by their titles, and the value being the entity_id.
◆ setInterval()
Drupal\tripal\Services\TripalPublish::setInterval |
( |
|
$interval | ) |
|
|
protected |
Updates the percent interval when the job progress is updated.
Updating the job progress incurrs a database write which takes time and if it occurs to frequently can slow down the loader. This should be a value between 0 and 100 to indicate a percent interval (e.g. 1 means update the progress every time the num_handled increases by 1%).
- Parameters
-
int | $interval | A number between 0 and 100. |
◆ setItemsHandled()
Drupal\tripal\Services\TripalPublish::setItemsHandled |
( |
|
$total_handled | ) |
|
|
protected |
Sets the number of items that have been processed.
This code was shamelessly copied from the TripalImporterBase class.
- Parameters
-
int | $total_handled | The total number of items that have been processed. |
◆ setTotalItems()
Drupal\tripal\Services\TripalPublish::setTotalItems |
( |
|
$total_items | ) |
|
|
protected |
Sets the total number if items to be processed.
This should typically be called near the beginning of the loading process to indicate the number of items that must be processed.
- Parameters
-
int | $total_items | The total number of items to process. |
◆ $bundle
string Drupal\tripal\Services\TripalPublish::$bundle = '' |
|
protected |
The id of the entity type (bundle)
◆ $datastore
string Drupal\tripal\Services\TripalPublish::$datastore = '' |
|
protected |
The id of the TripalStorage plugin.
◆ $entity_type
Drupal tripal Entity TripalEntityType Drupal\tripal\Services\TripalPublish::$entity_type = NULL |
|
protected |
Stores the bundle (entity type) object.
◆ $job
Drupal tripal Services TripalJob Drupal\tripal\Services\TripalPublish::$job = NULL |
|
protected |
◆ $logger
Drupal tripal Services TripalLogger Drupal\tripal\Services\TripalPublish::$logger = NULL |
|
protected |
◆ $required_types
array Drupal\tripal\Services\TripalPublish::$required_types = [] |
|
protected |
A list of property types that are required to uniquely identify an entity.
◆ $storage
Drupal tripal TripalStorage TripalStorageBase Drupal\tripal\Services\TripalPublish::$storage = NULL |
|
protected |
The TripalStorage object.
◆ $supported_actions
array Drupal\tripal\Services\TripalPublish::$supported_actions = ['store_id', 'store', 'store_link', 'store_pkey', 'read_value', 'replace', 'function'] |
|
protected |
Supported actions during publishing. Any field containing properties that are not in this list, will not be published!
◆ $unsupported_fields
array Drupal\tripal\Services\TripalPublish::$unsupported_fields |
|
protected |
Keep track of fields which are not supported in order to let the user know.
The documentation for this class was generated from the following file:
- tripal/src/Services/TripalPublish.php