You are here

class CivicrmEntityUIController in CiviCRM Entity 7

Same name and namespace in other branches
  1. 7.2 civicrm_entity_ui_controller.inc \CivicrmEntityUIController

Hierarchy

Expanded class hierarchy of CivicrmEntityUIController

1 string reference to 'CivicrmEntityUIController'
civicrm_entity_entity_info in ./civicrm_entity.module
Here we declare selected CiviCRM entities to Drupal.

File

./civicrm_entity_ui_controller.inc, line 3

View source
class CivicrmEntityUIController extends EntityContentUIController {
  public $overviewPagerLimit = 25;

  /**
   * Always use the same civicrm_entity_form
   * @return mixed
   */
  public function hook_forms() {
    $forms = parent::hook_forms();
    foreach ($this->entityInfo['bundles'] as $bundle => $bundle_info) {
      if (isset($bundle_info['admin'])) {
        $form_id = !isset($bundle) || $bundle == $this->entityType ? $this->entityType . '_form' : $this->entityType . '_edit_' . $bundle . '_form';
        $forms[$form_id] = array(
          'callback' => 'civicrm_entity_form',
        );
      }
    }
    return $forms;
  }
  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;
    */
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CivicrmEntityUIController::$overviewPagerLimit public property Defines the number of entries to show per page in overview table. Overrides EntityDefaultUIController::$overviewPagerLimit
CivicrmEntityUIController::hook_forms public function Always use the same civicrm_entity_form Overrides EntityDefaultUIController::hook_forms
CivicrmEntityUIController::overviewTable public function Generates the render array for a overview table for arbitrary entities matching the given conditions. Overrides EntityDefaultUIController::overviewTable
EntityContentUIController::hook_menu public function Provides definitions for implementing hook_menu(). Overrides EntityDefaultUIController::hook_menu 1
EntityContentUIController::operationFormSubmit public function Operation form submit callback. Overrides EntityDefaultUIController::operationFormSubmit
EntityDefaultUIController::$entityInfo protected property
EntityDefaultUIController::$entityType protected property
EntityDefaultUIController::$id_count protected property
EntityDefaultUIController::applyOperation public function Applies an operation to the given entity.
EntityDefaultUIController::entityFormSubmitBuildEntity public function Entity submit builder invoked via entity_ui_form_submit_build_entity().
EntityDefaultUIController::operationCount protected function Returns the operation count for calculating colspans.
EntityDefaultUIController::operationForm public function Builds the operation form.
EntityDefaultUIController::operationFormValidate public function Operation form validation callback.
EntityDefaultUIController::overviewForm public function Builds the entity overview form.
EntityDefaultUIController::overviewFormSubmit public function Overview form submit callback.
EntityDefaultUIController::overviewFormValidate public function Overview form validation callback.
EntityDefaultUIController::overviewTableHeaders protected function Generates the table headers for the overview table.
EntityDefaultUIController::overviewTableRow protected function Generates the row for the passed entity and may be overridden in order to customize the rows.
EntityDefaultUIController::__construct public function