You are here

public static function EntityShareUiClientEndpoint::loadAll in Entity Share 7

Load all endpoints.

Parameters

array $eids: Endpoint ids to load (optional).

bool $only_enabled: Load only the enabled endpoints if TRUE, else load all endpoints.

bool $reset: Bypass the static cache.

Return value

mixed The endpoints arrays or FALSE.

3 calls to EntityShareUiClientEndpoint::loadAll()
EntityShareUiClientEndpoint::load in modules/entity_share_ui/modules/entity_share_ui_client/includes/entity_share_ui_client.endpoint.inc
Load an endpoint.
entity_share_ui_endpoint_list in modules/entity_share_ui/modules/entity_share_ui_client/entity_share_ui_client.config.admin.inc
Node list table.
entity_share_ui_share_action_form in modules/entity_share_ui/modules/entity_share_ui_client/entity_share_ui_client.share.admin.inc
Form generation.

File

modules/entity_share_ui/modules/entity_share_ui_client/includes/entity_share_ui_client.endpoint.inc, line 62
Class for handling endpoints.

Class

EntityShareUiClientEndpoint
Endpoint management.

Code

public static function loadAll(array $eids = NULL, $only_enabled = FALSE, $reset = FALSE) {
  static $drupal_static_fast;
  if (!isset($drupal_static_fast)) {
    $drupal_static_fast['result'] =& drupal_static(__METHOD__);
  }
  $result =& $drupal_static_fast['result'];
  if (empty($eids)) {
    $eids = array(
      'ALL',
    );
  }
  $cache_key = implode('-', $eids);
  if (!isset($result[$cache_key]) || $reset) {
    $query = db_select(self::TABLE_NAME, 'e')
      ->fields('e');
    if (!empty($eids) && $eids[0] != 'ALL') {
      $query
        ->condition('eid', $eids, 'IN');
    }

    // Load only the enabled endpoints.
    if ($only_enabled) {
      $query
        ->condition('enabled', 1, '=');
    }
    $result[$cache_key] = $query
      ->execute()
      ->fetchAllAssoc('eid', PDO::FETCH_ASSOC);
  }
  return $result[$cache_key];
}