You are here

function _hosting_get_locked_platforms in Hosting 7.4

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

Helper function to get platforms that have been locked.

1 call to _hosting_get_locked_platforms()
_hosting_platform_is_locked in platform/hosting_platform.module
Helper function to check if a platform is locked.

File

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

Code

function _hosting_get_locked_platforms() {
  $return = array();
  $result = db_query("SELECT n.nid, n.title\n                      FROM {node} n\n                      LEFT JOIN {hosting_platform} h\n                      ON n.nid = h.nid\n                      WHERE n.type = :type\n                      AND n.status = :nstatus\n                      AND h.status = :hstatus\n                      ORDER BY n.title\n                     ", array(
    ':type' => 'platform',
    ':nstatus' => NODE_PUBLISHED,
    ':hstatus' => HOSTING_PLATFORM_LOCKED,
  ));
  while ($platform = $result
    ->fetch()) {
    $return[$platform->nid] = $platform->title;
  }
  return $return;
}