public function FacebookTrackingPixelTestHelper::delete_fb_tracking_role_variables in Facebook Tracking Pixel 7
Same name and namespace in other branches
- 8 tests/facebook_tracking_pixel.helper.php \facebookTrackingPixel\FacebookTrackingPixelTestHelper::delete_fb_tracking_role_variables()
Delete all variables.
File
- tests/
facebook_tracking_pixel.helper.php, line 72 - Contains tests for the Facebook Tracking Pixel module.
Class
Namespace
facebookTrackingPixelCode
public function delete_fb_tracking_role_variables() {
// Delete all variables via an SQL query.
$prefix = 'facebook_tracking_pixel_roles';
$result = db_select('variable', 'v')
->fields('v')
->condition('name', db_like($prefix) . '%', 'LIKE')
->execute()
->fetchAll();
foreach ($result as $item) {
db_delete('variable')
->condition('name', $item->name)
->execute();
}
}