You are here

function patterns_db_unpublish_pattern in Patterns 7

Same name and namespace in other branches
  1. 7.2 includes/db.inc \patterns_db_unpublish_pattern()

Sets the flag public to FALSE in the database for the pattern with the specified pattern id.

Parameters

mixed $pattern A pattern object, an array representing: the pattern object, a numeric id or alphanumeric name of the pattern as it is in the database

Return value

Bool TRUE, if successful

2 calls to patterns_db_unpublish_pattern()
drush_patterns_unpublish in ./patterns.drush.inc
patterns unpublish command callback.
patterns_unpublish_pattern in includes/servers.inc
Callback function for route /admin/patterns/unpublish/

File

includes/db.inc, line 484
Retrieve, save, and remove patterns from the database.

Code

function patterns_db_unpublish_pattern($pattern) {
  $pattern = _patterns_db_get_pattern($pattern);
  if (!$pattern) {
    return FALSE;
  }
  $pid = $pattern->pid;
  return db_query("UPDATE {patterns} SET public = 0 WHERE pid = :pid", array(
    'pid' => $pid,
  ));
}