|
| | __construct (array $configuration, $plugin_id, $plugin_definition, ChadoConnection $connection, ChadoBuddyPluginManager $buddy_manager) |
| |
| | getProperty (string $base_table, int $record_id, array $conditions, array $options=[]) |
| |
| | insertProperty (string $base_table, int $record_id, array $values, array $options=[]) |
| |
| | updateProperty (string $base_table, int $record_id, array $values, array $conditions, array $options=[]) |
| |
| | upsertProperty (string $base_table, int $record_id, array $values, array $options=[]) |
| |
| | deleteProperty (string $base_table, int $record_id, array $conditions, array $options=[]) |
| |
| | __construct (array $configuration, $plugin_id, $plugin_definition, ChadoConnection $connection) |
| |
| | label () |
| |
| | description () |
| |
|
| static | create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) |
| |
◆ __construct()
| Drupal\tripal_chado\Plugin\ChadoBuddy\ChadoPropertyBuddy::__construct |
( |
array |
$configuration, |
|
|
|
$plugin_id, |
|
|
|
$plugin_definition, |
|
|
ChadoConnection |
$connection, |
|
|
ChadoBuddyPluginManager |
$buddy_manager |
|
) |
| |
◆ create()
| static Drupal\tripal_chado\Plugin\ChadoBuddy\ChadoPropertyBuddy::create |
( |
ContainerInterface |
$container, |
|
|
array |
$configuration, |
|
|
|
$plugin_id, |
|
|
|
$plugin_definition |
|
) |
| |
|
static |
Implements ContainerFactoryPluginInterface->create().
We are injecting an additional dependency here, the ChadoBuddyPluginManager, so that this buddy can have access to the Dbxref buddy.
Since we have implemented the ContainerFactoryPluginInterface this static function will be called behind the scenes when a Plugin Manager uses createInstance(). Specifically this method is used to determine the parameters to pass to the constructor.
- Parameters
-
| \Symfony\Component\DependencyInjection\ContainerInterface | $container | |
| array | $configuration | |
| string | $plugin_id | |
| mixed | $plugin_definition | |
- Returns
- static
- Exceptions
-
tripal_chado\ChadoBuddy\Exceptions\ChadoBuddyException If an error is encountered.
Reimplemented from Drupal\tripal_chado\ChadoBuddy\ChadoBuddyPluginBase.
◆ deleteProperty()
| Drupal\tripal_chado\Plugin\ChadoBuddy\ChadoPropertyBuddy::deleteProperty |
( |
string |
$base_table, |
|
|
int |
$record_id, |
|
|
array |
$conditions, |
|
|
array |
$options = [] |
|
) |
| |
Deletes a chado property or multiple properties.
- Parameters
-
| string | $base_table | The base table for which the property should be associated. Thus to associate a property with a feature, the basetable=feature and a record is added to the featureprop table. |
| int | $record_id | The primary key of the basetable to that the property is associated with. |
| array | $conditions | An array where the key is a table+dot+column to describe the name of the property table and the column desired. Examples here are for the project table:
- projectprop.projectprop_id - (optional) property table primary key value
- projectprop.project_id - (optional) base table primary key value
- projectprop.type_id - a foreign key to cvterm_id
- projectprop.value - the value of the property
- projectprop.rank - optional rank of the property
- and possibly other columns for some property tables
- cv.cv_id
- cv.name
- cv.definition
- cvterm.cvterm_id
- cvterm.cv_id
- cvterm.name
- cvterm.definition
- cvterm.is_obsolete
- cvterm.is_relationshiptype
- dbxref.dbxref_id
- dbxref.db_id
- dbxref.description
- dbxref.accession
- dbxref.version
- db.db_id
- db.name
- db.description
- db.urlprefix
- db.url
- buddy_record = a ChadoBuddyRecord can be used in place of or in addition to other keys
|
| array | $options | (Optional)
- property_table - if the default of $base_table . 'prop' needs to be changed
- fkey - if the default of $base_table . '_id' needs to be changed
- pkey - if the default of $property_table . '_id' needs to be changed
- max_delete - specifies the maximum number of properties that can be deleted. Default is 1. Set to -1 for unlimited. If the limit is exceeded, a ChadoBuddyException is thrown.
|
- Returns
- int Returns a count of the number of records that were deleted.
- Exceptions
-
tripal_chado\ChadoBuddy\Exceptions\ChadoBuddyException If an error is encountered.
◆ getProperty()
| Drupal\tripal_chado\Plugin\ChadoBuddy\ChadoPropertyBuddy::getProperty |
( |
string |
$base_table, |
|
|
int |
$record_id, |
|
|
array |
$conditions, |
|
|
array |
$options = [] |
|
) |
| |
Retrieves a chado property.
- Parameters
-
| string | $base_table | The base table for which the property should be associated. Thus to associate a property with a feature, the basetable=feature and a record is added to the featureprop table. |
| int | $record_id | The primary key of the basetable to that the property is associated with. |
| array | $conditions | An array where the key is a table+dot+column to describe the name of the property table and the column desired. Examples here are for the project table:
- projectprop.projectprop_id - (optional) property table primary key value
- projectprop.project_id - (optional) base table primary key value
- projectprop.type_id - a foreign key to cvterm_id
- projectprop.value - the value of the property
- projectprop.rank - optional rank of the property
- and possibly other columns for some property tables
- cv.cv_id
- cv.name
- cv.definition
- cvterm.cvterm_id
- cvterm.cv_id
- cvterm.name
- cvterm.definition
- cvterm.is_obsolete
- cvterm.is_relationshiptype
- dbxref.dbxref_id
- dbxref.db_id
- dbxref.description
- dbxref.accession
- dbxref.version
- db.db_id
- db.name
- db.description
- db.urlprefix
- db.url
- buddy_record = a ChadoBuddyRecord can be used in place of or in addition to other keys
|
| array | $options | (Optional)
- property_table - if the default of $base_table . 'prop' needs to be changed
- fkey - if the default of $base_table . '_id' needs to be changed
- pkey - if the default of $property_table . '_id' needs to be changed
|
- Returns
- bool|array|ChadoBuddyRecord An array of ChadoBuddyRecord objects. More specifically, (1) if the select values return a single record then we return an array containing a single ChadoBuddyRecord describing the record. (2) if the select values return multiple records, then we return an array of ChadoBuddyRecords describing the results. (3) if there are no results then we return an empty array.
- Exceptions
-
tripal_chado\ChadoBuddy\Exceptions\ChadoBuddyException If an error is encountered.
◆ insertProperty()
| Drupal\tripal_chado\Plugin\ChadoBuddy\ChadoPropertyBuddy::insertProperty |
( |
string |
$base_table, |
|
|
int |
$record_id, |
|
|
array |
$values, |
|
|
array |
$options = [] |
|
) |
| |
Adds a new property linked to the specified base table and record
- Parameters
-
| string | $base_table | The base table for which the property should be associated. Thus to associate a property with a feature, the basetable=feature and a record is added to the featureprop table. |
| int | $record_id | The primary key of the basetable to that the property is associated with. |
| $values | An array where the key is a table+dot+column to describe the name of the property table and the column desired. Examples here are for the project table:
- projectprop.projectprop_id - (optional) property table primary key value
- projectprop.project_id - (optional) base table primary key value
- projectprop.type_id - a foreign key to cvterm_id
- projectprop.value - the value of the property
- projectprop.rank - optional rank of the property
- and possibly other columns for some property tables
- cv.cv_id
- cv.name
- cv.definition
- cvterm.cvterm_id
- cvterm.cv_id
- cvterm.name
- cvterm.definition
- cvterm.is_obsolete
- cvterm.is_relationshiptype
- dbxref.dbxref_id
- dbxref.db_id
- dbxref.description
- dbxref.accession
- dbxref.version
- db.db_id
- db.name
- db.description
- db.urlprefix
- db.url
- buddy_record = a ChadoBuddyRecord can be used in place of or in addition to other keys
|
| array | $options | (Optional)
- property_table - if the default of $base_table . 'prop' needs to be changed
- fkey - if the default of $base_table . '_id' needs to be changed
- pkey - if the default of $property_table . '_id' needs to be changed
- create_cvterm - set to TRUE (default FALSE) if you specified the necessary fields and want to create the dbxref and cvterm when creating this property, if they do not already exist.
|
- Returns
- ChadoBuddyRecord The inserted ChadoBuddyRecord will be returned on success and an exception will be thrown if an error is encountered. If the record already exists then an error will be thrown. If this is not the desired behaviour then use the upsert version of this method.
- Exceptions
-
tripal_chado\ChadoBuddy\Exceptions\ChadoBuddyException If an error is encountered.
◆ updateProperty()
| Drupal\tripal_chado\Plugin\ChadoBuddy\ChadoPropertyBuddy::updateProperty |
( |
string |
$base_table, |
|
|
int |
$record_id, |
|
|
array |
$values, |
|
|
array |
$conditions, |
|
|
array |
$options = [] |
|
) |
| |
Updates an existing property.
- Parameters
-
| string | $base_table | The base table for which the property should be associated. Thus to associate a property with a feature, the basetable=feature and a record is added to the featureprop table. |
| int | $record_id | The primary key of the basetable to that the property is associated with. |
| array | $values | Values for what you want the updated propert to contaion. An array where the key is a table+dot+column to describe the name of the property table and the column desired. Examples here are for the project table:
- projectprop.projectprop_id - (optional) property table primary key value
- projectprop.project_id - (optional) base table primary key value
- projectprop.type_id - a foreign key to cvterm_id
- projectprop.value - the value of the property
- projectprop.rank - optional rank of the property
- and possibly other columns for some property tables
- cv.cv_id
- cv.name
- cv.definition
- cvterm.cvterm_id
- cvterm.cv_id
- cvterm.name
- cvterm.definition
- cvterm.is_obsolete
- cvterm.is_relationshiptype
- dbxref.dbxref_id
- dbxref.db_id
- dbxref.description
- dbxref.accession
- dbxref.version
- db.db_id
- db.name
- db.description
- db.urlprefix
- db.url
- buddy_record = a ChadoBuddyRecord can be used in place of or in addition to other keys
|
| array | $conditions | An associative array of the conditions to find the record to update. Although the same keys are supported as those indicated for the $values, only columns that are part of a unique constraint will be used for the database query. e.g. you can't query on the property value. |
| array | $options | (Optional)
- property_table - if the default of $base_table . 'prop' needs to be changed
- fkey - if the default of $base_table . '_id' needs to be changed
- pkey - if the default of $property_table . '_id' needs to be changed
|
- Returns
- bool|ChadoBuddyRecord The updated ChadoBuddyRecord will be returned on success, FALSE will be returned if no record was found to update.
- Exceptions
-
tripal_chado\ChadoBuddy\Exceptions\ChadoBuddyException If an error is encountered.
◆ upsertProperty()
| Drupal\tripal_chado\Plugin\ChadoBuddy\ChadoPropertyBuddy::upsertProperty |
( |
string |
$base_table, |
|
|
int |
$record_id, |
|
|
array |
$values, |
|
|
array |
$options = [] |
|
) |
| |
Insert a property if it doesn't yet exist OR update it if does.
- Parameters
-
| string | $base_table | The base table for which the property should be associated. Thus to associate a property with a feature, the basetable=feature and a record is added to the featureprop table. |
| int | $record_id | The primary key of the basetable to that the property is associated with. |
| array | $values | An array where the key is a table+dot+column to describe the name of the property table and the column desired. Examples here are for the project table:
- projectprop.projectprop_id - (optional) property table primary key value
- projectprop.project_id - (optional) base table primary key value
- projectprop.type_id - a foreign key to cvterm_id
- projectprop.value - the value of the property
- projectprop.rank - optional rank of the property
- and possibly other columns for some property tables
- cv.cv_id
- cv.name
- cv.definition
- cvterm.cvterm_id
- cvterm.cv_id
- cvterm.name
- cvterm.definition
- cvterm.is_obsolete
- cvterm.is_relationshiptype
- dbxref.dbxref_id
- dbxref.db_id
- dbxref.description
- dbxref.accession
- dbxref.version
- db.db_id
- db.name
- db.description
- db.urlprefix
- db.url
- buddy_record = a ChadoBuddyRecord can be used in place of or in addition to other keys
|
| array | $options | (Optional)
- property_table - if the default of $base_table . 'prop' needs to be changed
- fkey - if the default of $base_table . '_id' needs to be changed
- pkey - if the default of $property_table . '_id' needs to be changed
- create_cvterm - set to TRUE (default FALSE) if you have the necessary fields and want to create the dbxref and cvterm when creating this property, if they do not already exist.
|
- Returns
- ChadoBuddyRecord The inserted/updated ChadoBuddyRecord will be returned on success.
- Exceptions
-
tripal_chado\ChadoBuddy\Exceptions\ChadoBuddyException If an error is encountered.
◆ $buddy_manager
| object Drupal\tripal_chado\Plugin\ChadoBuddy\ChadoPropertyBuddy::$buddy_manager |
|
protected |
Used to store the manager so we can access the Cvterm buddy
◆ $cvterm_instance
| object Drupal\tripal_chado\Plugin\ChadoBuddy\ChadoPropertyBuddy::$cvterm_instance |
|
protected |
Cache the cvterm instance here
The documentation for this class was generated from the following file:
- tripal_chado/src/Plugin/ChadoBuddy/ChadoPropertyBuddy.php