You are here

function view_mode_page_delete_entity_patterns in View Mode Page 7.2

Same name and namespace in other branches
  1. 8.2 view_mode_page.module \view_mode_page_delete_entity_patterns()

Delete URL patterns from the database.

The query may be used with no arguments or with one or more arguments. Each argument increases the specificity of the delete process.

This does not necessarily effect the patterns saved in the menu_router table. It only removes the patterns from the View Mode Page table.

Parameters

string $entity_type: The name of the entity type that the pattern is used for.

string $content_type: The name of the content type that the pattern is used for.

string $view_mode: The name of the view mode.

string $pattern: The URL pattern that is used in the hook_menu() call.

4 calls to view_mode_page_delete_entity_patterns()
ViewModePageTestCase::testDeleteEntityPattern in ./view_mode_page.test
Test deleting a pattern with the entity based function
view_mode_page_delete_patterns in ./view_mode_page.module
DEPRECATED: Delete URL patterns from the database.
view_mode_page_form_submit in ./view_mode_page.module
Implements hook_form_submit().
view_mode_page_remove_pattern_submit in ./view_mode_page.module
Submit handler for the remove pattern form

File

./view_mode_page.module, line 562
View Mode Page module allows users to add a page for a specific view mode.

Code

function view_mode_page_delete_entity_patterns($entity_type = NULL, $content_type = NULL, $view_mode = NULL, $pattern = NULL) {
  $query = db_delete('view_mode_page');
  if ($entity_type) {
    $query
      ->condition('entity_type', $entity_type, '=');
  }
  if ($content_type) {
    $query
      ->condition('content_type', $content_type, '=');
  }
  if ($view_mode) {
    $query
      ->condition('view_mode', $view_mode, '=');
  }
  if ($pattern) {
    $query
      ->condition('url_pattern', $pattern, '=');
  }
  $result = $query
    ->execute();
  module_invoke_all('view_mode_page_entity_patterns_deleted', $entity_type, $content_type, $view_mode, $pattern);
  module_invoke_all('view_mode_page_patterns_deleted', $content_type, $view_mode, $pattern);
  return $result;
}