You are here

function hosting_platform_path_exists in Hosting 7.4

Same name and namespace in other branches
  1. 7.3 platform/hosting_platform.module \hosting_platform_path_exists()

Determine whether a given path has already been used with an existing platform.

1 call to hosting_platform_path_exists()
hosting_platform_validate in platform/hosting_platform.module
Implements hook_validate().

File

platform/hosting_platform.module, line 717
Platform node type definition.

Code

function hosting_platform_path_exists($path) {
  $result = db_query("SELECT\n        n.title AS name,\n        h.nid\n    FROM {hosting_platform} AS h\n      INNER JOIN {node} AS n ON n.nid = h.nid\n    WHERE publish_path = !publish_path\n      OR git_root = !publish_path\n      AND h.status >= !h.status", array(
    '!publish_path' => hosting_path_normalize($path),
    '!h.status' => HOSTING_PLATFORM_QUEUED,
  ))
    ->fetch();
  return $result;
}