The Chado Properties API provides a set of functions for interacting with the any chado prop table.
◆ chado_delete_property()
chado_delete_property |
( |
|
$record, |
|
|
|
$property |
|
) |
| |
Deletes a property for a given base table record using the property name.
- Parameters
-
$record | An associative array used to identify the record to which the property should be deleted. The following keys must be used: -table: The base table for which the property should be deleted. Thus to update a property for a feature the base_table=feature. -id: The primary key value of the base table. The property will be deleted from the record that matches this id. -prop_id: The primary key in the [table]prop table to be deleted. If this value is supplied then the 'id' key is not needed. |
$property | An associative array used to specify the property to be updated. It can contain the following keys. The keys must be specified to uniquely identify the term to be applied. If the options identify more than one CV term then an error will occur. -type_name: The cvterm name to be selected. -type_id: The cvterm_id of the term to be selected. -cv_id: The cv_id of the CV that contains the term. -cv_name: The name of the CV that contains the term. -value: The specific value for the property. -rank: The specific rank for the property. |
- Returns
- Return TRUE on successful deletion and FALSE otherwise.
◆ chado_get_property()
chado_get_property |
( |
|
$record, |
|
|
|
$property |
|
) |
| |
Retrieve a property for a given base table record.
- Parameters
-
$record | An array used to identify the record to which the property is associated. The following keys must be used: -table: The base table for which the property should be updated. Thus to update a property for a feature the base_table=feature. -id: The primary key value of the base table. The property will be associated with the record that matches this id. -prop_id: The primary key in the [table]prop table. If this value is supplied then the 'id' key is not needed. |
$property | An associative array used to specify the property to be selected. It can contain the following keys. The keys must be specified to uniquely identify the term to be applied. If the options identify more than one CV term then an error will occur. -type_name: The cvterm name to be selected. -type_id: The cvterm_id of the term to be selected. -cv_id: The cv_id of the CV that contains the term. -cv_name: The name of the CV that contains the term. -value: The specific value for the property. -rank: The specific rank for the property. |
- Returns
- An array in the same format as that generated by the function chado_generate_var(). If only one record is returned it is a single object. If more than one record is returned then it is an array of objects
◆ chado_get_record_with_property()
chado_get_record_with_property |
( |
|
$record, |
|
|
|
$property, |
|
|
|
$options = [] |
|
) |
| |
Get all records in the base table assigned one or more properties.
The property or properties of interest are specified using the $property argument.
- Parameters
-
$record | An associative array used to identify the table and subset of records to to be searched: -table: The base table for which the property should be updated. Thus to update a property for a feature the base_table=feature. -base_records: An array in the format accepted by the chado_select_record for specifying a subset of records in the base table. |
$property | An associative array used to specify the property to be selected for. It can contain the following keys. The keys must be specified to uniquely identify the term to be searched. If the options identify more than one CV term then an error will occur. -type_name: The cvterm name to be selected. -type_id: The cvterm_id of the term to be selected. -cv_id: The cv_id of the CV that contains the term. -cv_name: The name of the CV that contains the term. -value: The specific value for the property. -rank: The specific rank for the property. -cvalue_id: The cvterm_id of the value for the property. note cvalue_id is an anticipated column in the the next Chado release (1.4). It is included here for early adopters. |
$options | An array of options supported by chado_generate_var(). These keys are used for generating the cvterm objects returned by this function. |
- Returns
- An array of chado variables with the given property.
◆ chado_get_table_property_types()
chado_get_table_property_types |
( |
|
$prop_table | ) |
|
Retrieves all of the property types currently availalbe in a prop table.
- Parameters
-
$prop_table | The name of the property table. |
- Exceptions
-
- Returns
- An array of cvterm objects as created by chado_generate_var().
◆ chado_insert_property()
chado_insert_property |
( |
|
$record, |
|
|
|
$property, |
|
|
|
$options = [] |
|
) |
| |
Insert a property for a given base table.
By default if the property already exists a new property is added with the next available rank. If the option 'update_if_present' is specified then the record will be updated if it exists rather than adding a new property.
- Parameters
-
$record | An associative array used to identify the record to which the property should be assigned. The following keys must be used: -table: The base table for which the property should be inserted. Thus to insert a property for a feature the base_table=feature and property is inserted into featureprop. -id: The primary key value of the base table. The property will be associated with the record that matches this id. |
$property | An associative array used to specify the property to be added. It can contain the following keys. The keys must be specified to uniquely identify the term to be applied. If the options identify more than one CV term then an error will occur. -type_name: The cvterm name to be selected. -type_id: The cvterm_id of the term to be selected. -cv_id: The cv_id of the CV that contains the term. -cv_name: The name of the CV that contains the term. -value: The specific value for the property. -rank: The specific rank for the property. |
$options | An associative array containing the following keys: -update_if_present: A boolean indicating whether an existing record should be updated. If the property already exists and this value is not specified or is zero then a new property will be added with the next largest rank. -force_rank: If the specified rank is already used by another property recrod for the same base_id, then set force_rank to TRUE to require that only the specified rank can be used. Otherwise, the next available rank will be used. If 'update_if_present' is FALSE and 'force_rank' is set then an error will occur. |
- Returns
- Return TRUE if successful and FALSE otherwise.
◆ chado_update_property()
chado_update_property |
( |
|
$record, |
|
|
|
$property, |
|
|
|
$options = [] |
|
) |
| |
Update a property for a given base table record and property name.
- Parameters
-
$record | An associative array used to identify the record to which the property should be updated. The following keys must be used: -table: The base table for which the property should be updated. Thus to update a property for a feature the base_table=feature. -id: The primary key value of the base table. The property will be associated with the record that matches this id. -prop_id: The primary key in the [table]prop table. If this value is supplied then the 'table' and 'id' keys are not needed. |
$property | An associative array used to specify the property to be updated. It can contain the following keys. The keys must be specified to uniquely identify the term to be applied. If the options identify more than one CV term then an error will occur. -type_name: The cvterm name to be selected. -type_id: The cvterm_id of the term to be selected. -cv_id: The cv_id of the CV that contains the term. -cv_name: The name of the CV that contains the term. -value: The specific value for the property. -rank: The specific rank for the property. -cvalue_id: The cvterm_id of the value for the property. note cvalue_id is an anticipated column in the the next Chado release (1.4). It is included here for early adopters. |
$options | An associative array containing the following keys: -insert_if_missing: A boolean indicating whether a record should be inserted if one doesn't exist to update. |
- Returns
- Return TRUE on Update/Insert and FALSE otherwise.