◆ __construct()
TripalFieldDownloader::__construct |
( |
|
$collection_id, |
|
|
|
$outfile_name |
|
) |
| |
Constructs a new instance of the TripalFieldDownloader class.
- Parameters
-
$collection_id | The ID for the collection. |
$outfile_name | The name of the output file to create. The name should not include a path. |
◆ delete()
TripalFieldDownloader::delete |
( |
| ) |
|
Removes the downloadable file.
◆ download()
TripalFieldDownloader::download |
( |
| ) |
|
Setups a download stream for the file.
◆ formatEntity()
TripalFieldDownloader::formatEntity |
( |
|
$entity | ) |
|
|
abstractprotected |
◆ getHeader()
TripalFieldDownloader::getHeader |
( |
| ) |
|
|
abstractprotected |
◆ getURL()
TripalFieldDownloader::getURL |
( |
| ) |
|
Retrieves the URL for the downloadable file.
◆ isFieldSupported()
TripalFieldDownloader::isFieldSupported |
( |
|
$field, |
|
|
|
$instance |
|
) |
| |
◆ setFields()
TripalFieldDownloader::setFields |
( |
| ) |
|
|
protected |
◆ setFields2Terms()
TripalFieldDownloader::setFields2Terms |
( |
| ) |
|
|
protected |
Sets the fields2term array.
The fields2term array provides an easy lookup for mapping a term to it's accession number.
◆ setPrintableFields()
TripalFieldDownloader::setPrintableFields |
( |
| ) |
|
|
protected |
Conslidates all the fields into a single list of accession numbers.
The array of printable fields will contain an array containing the accession number and the label. The title used is from the first occurance of an accession.
◆ write()
TripalFieldDownloader::write |
( |
TripalJob |
$job = NULL | ) |
|
Creates the downloadable file.
- Parameters
-
$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. |
◆ writeDone()
TripalFieldDownloader::writeDone |
( |
TripalJob |
$job = NULL | ) |
|
Closes the output file once writing of all entities is completed.
- Parameters
-
◆ writeEntity()
TripalFieldDownloader::writeEntity |
( |
|
$entity, |
|
|
TripalJob |
$job = NULL |
|
) |
| |
Write a single entity to the file.
Before calling this function call the initWrite() function to establish the file and write headers.
- Parameters
-
◆ writeInit()
TripalFieldDownloader::writeInit |
( |
TripalJob |
$job = NULL | ) |
|
◆ $collection
TripalFieldDownloader::$collection = NULL |
|
protected |
The data collection assigned to this downloader.
◆ $collection_bundles
TripalFieldDownloader::$collection_bundles = NULL |
|
protected |
An array of collection_bundle records for the content types that belong to this data collection.
◆ $collection_id
TripalFieldDownloader::$collection_id = NULL |
|
protected |
◆ $default_extension
TripalFieldDownloader::$default_extension = 'txt' |
|
static |
Indicates the default extension for the outputfile.
◆ $fh
TripalFieldDownloader::$fh |
|
protected |
The file handle for an opeend file using during writing.
◆ $fields
TripalFieldDownloader::$fields = [] |
|
protected |
A list of field and instance items, indexed first by site_id with 'local' being the key for local fields and the numeric site_id for remote fields. The second-levle key is the bundle_name and the the field_id. Below the field_id are the keys 'field' or 'instance' where the value of each is the field or instance details respectively.
◆ $fields2terms
TripalFieldDownloader::$fields2terms = [] |
|
protected |
An array that associates a field ID with a term.
The first-level key is the site ID. For the local site this will be the word 'local' for all others it will be the numeric id. The second level key is the bundle bundle name. For local bundles this will always be bio_data_xxxx. Third, are two subkeys: by_field and by_accession. To lookup a field's term you use the 'by_field' subkey with the field_id as the next level. To lookup the field ID for a term use the 'by_accession' subkey with the accession as the next level. Below is an example of the structure of this array.
Array (
[local] => Array(
[bio_data_7] => Array(
[by_field] => Array(
[56] => data:2091,
[57] => OBI:0100026,
[17] => schema:name,
[58] => data:2044,
[34] => data:0842,
[67] => schema:alternateName,
),
[by_accession] => Array (
[data:2091] => 56,
[OBI:0100026] => 57,
[schema:name] => 17,
[data:2044] => 58,
[data:0842] => 34,
[schema:alternateName] => 67,
),
),
),
)
◆ $full_label
TripalFieldDownloader::$full_label = 'Generic File format' |
|
static |
A more verbose label that better describes the formatter.
◆ $label
TripalFieldDownloader::$label = 'Generic' |
|
static |
Sets the label shown to the user describing this formatter. It should be a short identifier. Use the $full_label for a more descriptive label.
◆ $outfile
TripalFieldDownloader::$outfile = '' |
|
protected |
◆ $printable_fields
TripalFieldDownloader::$printable_fields = [] |
|
protected |
An array of printable fields. Because fields can come from multiple bundles and those bundles can be from multiple sites, it is possible that 1) two bundles use the same field and we want to conslidate to a single printable field; and 2) that a remote site may use the same term for a field as a bundle on the local site. The only way to sort out this mess is to use the term accession numbers. Therefore, the array contains a unique list of printable fields using their accession numbers as keys and a field label as the value.
◆ $remote_entity
TripalFieldDownloader::$remote_entity = '' |
|
protected |
The remote site json data returned for the entity
The documentation for this class was generated from the following file:
- tripal/includes/TripalFieldDownloaders/TripalFieldDownloader.inc