You are here

function patterns_db_publish_pattern in Patterns 7

Same name and namespace in other branches
  1. 7.2 includes/db.inc \patterns_db_publish_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

3 calls to patterns_db_publish_pattern()
drush_patterns_publish in ./patterns.drush.inc
patterns publish command callback.
patterns_d2d_push_patterns_server in patterns_d2d/includes/patterns_d2d.srpc.inc
patterns_publish_pattern in includes/servers.inc
Callback function for route /admin/patterns/publish/

File

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

Code

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