function rdf_example_uninstall in Examples for Developers 7
Implements hook_uninstall().
Related topics
File
- rdf_example/
rdf_example.install, line 108 - Install file for RDF Example module.
Code
function rdf_example_uninstall() {
// Delete recipe content.
$sql = 'SELECT nid FROM {node} n WHERE n.type = :type';
$result = db_query($sql, array(
':type' => 'recipe',
));
$nids = array();
foreach ($result as $row) {
$nids[] = $row->nid;
}
node_delete_multiple($nids);
// Delete field instances for now.
// Check status of http://drupal.org/node/1015846
$instances = field_info_instances('node', 'recipe');
foreach ($instances as $instance_name => $instance) {
field_delete_instance($instance);
}
// Delete node type.
node_type_delete('recipe');
field_purge_batch(1000);
}