You are here

public function CivicrmEntityUIController::overviewTable in CiviCRM Entity 7

Same name and namespace in other branches
  1. 7.2 civicrm_entity_ui_controller.inc \CivicrmEntityUIController::overviewTable()

Generates the render array for a overview table for arbitrary entities matching the given conditions.

Parameters

$conditions: An array of conditions as needed by entity_load().

Return value

array A renderable array.

Overrides EntityDefaultUIController::overviewTable

File

./civicrm_entity_ui_controller.inc, line 23

Class

CivicrmEntityUIController

Code

public function overviewTable($conditions = array()) {

  /*
      $query = new EntityFieldQuery();
      $query->entityCondition('entity_type', $this->entityType);

      // Add all conditions to query.
      foreach ($conditions as $key => $value) {
        $query->propertyCondition($key, $value);
      }

      if ($this->overviewPagerLimit) {
        $query->pager($this->overviewPagerLimit);
      }

      $results = $query->execute();

      $ids = isset($results[$this->entityType]) ? array_keys($results[$this->entityType]) : array();
      $entities = $ids ? entity_load($this->entityType, $ids) : array();
      ksort($entities);

      $rows = array();
      foreach ($entities as $entity) {
        $rows[] = $this->overviewTableRow($conditions, entity_id($this->entityType, $entity), $entity);
      }

      $render = array(
        '#theme' => 'table',
        '#header' => $this->overviewTableHeaders($conditions, $rows),
        '#rows' => $rows,
        '#empty' => t('None.'),
      );
      return $render;
  */
}