public function SocialContent::deleteInstance in Social Content 7.2
Delete the current instance as well as it's history if required.
Parameters
bool $delete_history: Whether to also remove the instance's history.
Return value
int The number of deleted entries from the history.
File
- ./
social_content.class.inc, line 517 - Social Content class.
Class
- SocialContent
- TODO: Table names should be a property for ease of change Separate this class into smaller classes.
Code
public function deleteInstance($delete_history = TRUE) {
db_delete('social_content_instances')
->condition('id', $this->settings['instance']['id'])
->execute();
$deleted = 0;
if ($delete_history) {
$deleted = db_delete('social_content_history')
->condition('instance', $this->settings['instance']['id'])
->execute();
}
return $deleted;
}