◆ __construct()
TripalEntityCollection::__construct |
( |
| ) |
|
◆ addBundle()
TripalEntityCollection::addBundle |
( |
|
$details | ) |
|
Creates a new tripal_collection_bundle entry.
- Parameters
-
$details | An association array containing the details for a collection. The details must include the following key/value pairs:
- bundle_name: The name of the TripalEntity content type.
- ids: An array of the entity IDs that form the collection.
- fields: An array of the field IDs that the collection is limited to.
|
- Exceptions
-
◆ create()
TripalEntityCollection::create |
( |
|
$details | ) |
|
Creates a new data collection.
To add bundles with entities and fields to a collection, use the addBundle() function after the collection is created.
- Parameters
-
$details | An association array containing the details for a collection. The details must include the following key/value pairs:
- uid: The ID of the user that owns the collection
- collection_name: The name of the collection
- description: A user supplied description for the collection.
|
- Exceptions
-
◆ delete()
TripalEntityCollection::delete |
( |
| ) |
|
Deletes the current collection
◆ getBundles()
TripalEntityCollection::getBundles |
( |
| ) |
|
Retrieves the list of bundles associated with the collection.
- Returns
- An array of bundles.
◆ getBundleSiteId()
TripalEntityCollection::getBundleSiteId |
( |
|
$bundle_name | ) |
|
Retrieves the site id for this specific bundle fo the collection.
- Returns
- A remote site ID, or an empty string if the bundle is local.
◆ getCollectionID()
TripalEntityCollection::getCollectionID |
( |
| ) |
|
Retrieves the collection ID.
- Returns
- A numeric ID for this collection.
◆ getCreateDate()
TripalEntityCollection::getCreateDate |
( |
|
$formatted = TRUE | ) |
|
Retrieves the date that the basket was created.
- Parameters
-
$formatted | If TRUE then the date time will be formatted for human readability. |
- Returns
- A UNIX time stamp string containing the date or a human-readable string if $formatted = TRUE.
◆ getDescription()
TripalEntityCollection::getDescription |
( |
| ) |
|
Retrieves the collection description
- Returns
- A string containing the description of the collection.
◆ getEntityIDs()
TripalEntityCollection::getEntityIDs |
( |
|
$bundle_name | ) |
|
Retrieves the list of entity IDs.
- Returns
- An array of numeric entity IDs.
◆ getFieldIDs()
TripalEntityCollection::getFieldIDs |
( |
|
$bundle_name | ) |
|
Retrieves the list of fields in the basket.
- Returns
- An array of numeric field IDs.
◆ getFormatters()
TripalEntityCollection::getFormatters |
( |
| ) |
|
Retrieves the list of appropriate download formatters for the basket.
- Returns
- An associative array where the key is the TripalFieldDownloader class name and the value is the human-readable label for the formatter.
◆ getName()
TripalEntityCollection::getName |
( |
| ) |
|
Retrieves the name of the collection.
- Returns
- A string containing the name of the collection.
◆ getOutfile()
TripalEntityCollection::getOutfile |
( |
|
$formatter | ) |
|
Retrieves the output filename for the desired formatter.
- Parameters
-
$formatter | The class name of the formatter to use. The formatter must be compatible with the data collection. |
- Exceptions
-
◆ getOutfilePath()
TripalEntityCollection::getOutfilePath |
( |
|
$formatter | ) |
|
Retrieves the path for the downloadable file.
The path is in the Drupal URI format.
- Parameters
-
$formatter | The name of the class |
◆ getOutfileURL()
TripalEntityCollection::getOutfileURL |
( |
|
$formatter | ) |
|
Retrieves the URL for the downloadable file.
- Parameters
-
$formatter | The name of the class |
◆ getUser()
TripalEntityCollection::getUser |
( |
| ) |
|
Retrieves the user object of the user that owns the collection
- Returns
- A Drupal user object.
◆ getUserID()
TripalEntityCollection::getUserID |
( |
| ) |
|
Retrieves the ID of the user that owns the collection
- Returns
- The numeric User ID.
◆ isFormatterCompatible()
TripalEntityCollection::isFormatterCompatible |
( |
|
$formatter | ) |
|
|
protected |
Indicates if the given formatter is compatible with the data collection.
- Parameters
-
$formatter | The class name of the formatter to check. |
- Returns
- boolean TRUE if the formatter is compatible, FALSE otherwise.
◆ load()
TripalEntityCollection::load |
( |
|
$collection_id | ) |
|
Loads an existing collection using a collection ID.
- Parameters
-
$collection_id | The ID of the collection to load. |
- Exceptions
-
◆ write()
TripalEntityCollection::write |
( |
|
$formatter = NULL , |
|
|
TripalJob |
$job = NULL |
|
) |
| |
Writes the collection to a file using a given formatter.
- Parameters
-
formatter | The name of the formatter class to use (e.g. TripalTabDownloader). The formatter must be compatible with the data collection. If no formatter is supplied then all file formats supported by this data collection will be created. |
$job | If this function is run as a Tripal Job then this argument can be set to the Tripaljob object for keeping track of progress. |
- Exceptions
-
◆ $bundles
TripalEntityCollection::$bundles = [] |
|
protected |
The name of the bundles (i.e. content type) to which the entities belong.
◆ $collection_id
TripalEntityCollection::$collection_id = NULL |
|
protected |
◆ $collection_name
TripalEntityCollection::$collection_name = '' |
|
protected |
The name of this collection.
◆ $create_date
TripalEntityCollection::$create_date = '' |
|
protected |
The date that the collection was created.
◆ $description
TripalEntityCollection::$description = '' |
|
protected |
The description for this collection.
◆ $fields
TripalEntityCollection::$fields = [] |
|
protected |
◆ $formatters
TripalEntityCollection::$formatters = [] |
|
protected |
The list of downloaders available for this bundle.
◆ $ids
TripalEntityCollection::$ids = [] |
|
protected |
An array of numeric entities IDs.
◆ $user
TripalEntityCollection::$user = [] |
|
protected |
The user object of the user that owns the collection.
The documentation for this class was generated from the following file:
- tripal/includes/TripalEntityCollection.inc