You are here

function certificate_certificate_load_all in Certificate 6.2

Same name and namespace in other branches
  1. 8.3 certificate.module \certificate_certificate_load_all()
  2. 6 certificate.module \certificate_certificate_load_all()
  3. 7.3 certificate.module \certificate_certificate_load_all()
  4. 7.2 certificate.module \certificate_certificate_load_all()
  5. 3.x certificate.module \certificate_certificate_load_all()

Public loader function for the full collection of certificates.

@todo cache?

Return value

An array of all certificates, keyed by node (certificate) ID.

3 calls to certificate_certificate_load_all()
certificate_get_template_options in ./certificate.module
Return an array of certificate templates suitable for use in an options form element.
certificate_mapping_form in ./certificate.admin.inc
Add mapping elements to a form.
certificate_type_mapping_form in ./certificate.admin.inc
Returns the form for the per-node certificate settings.

File

./certificate.module, line 252
Certificate module.

Code

function certificate_certificate_load_all() {
  $sql = "SELECT *, nid AS cid FROM {node} n WHERE type = 'certificate'";
  $result = db_query($sql);
  $certificates = array();
  while ($certificate = db_fetch_array($result)) {
    $certificates[$certificate['cid']] = $certificate;
  }
  drupal_alter('certificate_template_options', $certificates);
  return $certificates;
}