function tripal_core_delete_property

2.x tripal_core.DEPRECATED.api.inc tripal_core_delete_property($basetable, $record_id, $property, $cv_name)
3.x tripal_core.DEPRECATED.inc tripal_core_delete_property($basetable, $record_id, $property, $cv_name)
1.x tripal_core_chado.api.inc tripal_core_delete_property($basetable, $record_id, $property, $cv_name)

Deletes a property for a given base table record using the property name

Parameters

$basetable: The base table for which the property should be deleted. Thus to deleted a property for a feature the basetable=feature and property is deleted from featureprop

$record_id: The primary key of the basetable to delete a property for. This should be in integer.

$property: The cvterm name describing the type of property to be deleted

$cv_name: The name of the cv that the above cvterm is part of

Note: The property to be deleted is select via the unique combination of $record_id and $property

Return value

Return True on Delete and False otherwise

Related topics

8 calls to tripal_core_delete_property()
tripal_analysis_delete_property in tripal_analysis/api/tripal_analysis.api.inc
Delete a given property
tripal_contact_delete_property in tripal_contact/api/tripal_contact.api.inc
Delete a given property
tripal_featuremap_delete_property in tripal_featuremap/api/tripal_featuremap.api.inc
Delete a given property
tripal_feature_analysis_delete_property in tripal_feature/api/tripal_feature.api.inc
Delete an analysis feature property using the property name. Use this when a property only exists once for a given analysis feature. When more than one value can exist for the same property use the tripal_feature_analysis_delete_property_by_id()…
tripal_feature_delete_property in tripal_feature/api/tripal_feature.api.inc
Delete a given feature property using the property name. Only use this if the property is unique and only exists once for the feature.

... See full list

File

tripal_core/api/tripal_core_chado.api.inc, line 2830
The Tripal Core API

Code

function tripal_core_delete_property($basetable, $record_id, $property, $cv_name) {

  // get the foreign key for this property table
  $table_desc = tripal_core_get_chado_table_schema($basetable . 'prop');
  $fkcol = key($table_desc['foreign keys'][$basetable]['columns']);

  // construct the array that will match the exact record to update
  $match = array(
    $fkcol => $record_id,
    'type_id' => array(
      'cv_id' => array(
        'name' => $cv_name,
      ),
      'name' => $property,
    ),
  );

  return tripal_core_chado_delete($basetable . 'prop', $match);
}