You are here

public static function MerciDefaultController::getInstance in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.3

File

merci_core/reservation.handler.inc, line 28
Abstraction of the selection logic of an entity reference field.

Class

MerciDefaultController
A null implementation of EntityReference_SelectionHandler.

Code

public static function getInstance($entity, $item_type, $context) {
  if (class_exists($class_name = 'MerciDefaultController_' . $item_type)) {
    return new $class_name($entity, $item_type, $context);
  }
  else {
    return new MerciDefaultController($entity, $item_type, $context);
  }
}