You are here

function bean_services_delete in Bean (for Drupal 7) 7

Delete a bean.

Parameters

$bid: Unique identifier of the bean to delete.

Return value

True.

1 string reference to 'bean_services_delete'
bean_services_resources in ./bean.services.inc
Implements hook_services_resources().

File

./bean.services.inc, line 224
Contains callbacks for service resource manipulation.

Code

function bean_services_delete($bid) {
  $bean = bean_load($bid);
  if (empty($bean)) {
    return services_error(t('There is no bean found with id @bid.', array(
      '@bid' => $bid,
    )), 404);
  }

  // Delete bean.
  bean_delete($bean);

  // Clear the bean cache so an anonymous user sees that the bean was deleted.
  bean_reset();
  return TRUE;
}