/** * Implements EntityReferenceHandler::getInstance(). */ public static function getInstance($field, $instance = NULL, $entity_type = NULL, $entity = NULL) { if ($field['settings']['target_type'] !== 'node') { return EntityReference_SelectionHandler_Broken::getInstance($field, $instance); } return new OaGroupsSelectionHandler($field, $instance); }
/** * Implements EntityReferenceHandler::getInstance(). */ public static function getInstance($field, $instance = NULL, $entity_type = NULL, $entity = NULL) { if ($field['settings']['target_type'] !== 'user') { return EntityReference_SelectionHandler_Broken::getInstance($field, $instance); } return new OaWorkTracker_SelectionHandler_Assigned(); }
/** * {@inheritdoc} */ public static function getInstance($field, $instance = NULL, $entity_type = NULL, $entity = NULL) { $target_entity_type = $field['settings']['target_type']; // Check if the entity type does exist and has a base table. $entity_info = entity_get_info($target_entity_type); if (empty($entity_info['base table']) || $target_entity_type != 'user') { return EntityReference_SelectionHandler_Broken::getInstance($field, $instance); } return new ProjectIssue_SelectionHandler_Assigned($field, $instance, $entity_type, $entity); }
/** * {@inheritdoc} */ public static function getInstance($field, $instance = NULL, $entity_type = NULL, $entity = NULL) { $target_entity_type = $field['settings']['target_type']; // Check if the entity type does exist and has a base table. $entity_info = entity_get_info($target_entity_type); // We only work with a target of 'node', as issues must be nodes. if (empty($entity_info['base table']) || $target_entity_type != 'node') { return EntityReference_SelectionHandler_Broken::getInstance($field, $instance); } return new ProjectIssue_SelectionHandler_Issues($field, $instance, $entity_type, $entity); }
/** * Implements EntityReferenceHandler::getInstance(). */ public static function getInstance($field, $instance = NULL, $entity_type = NULL, $entity = NULL) { $target_entity_type = $field['settings']['target_type']; if ($target_entity_type != 'commerce_store') { return EntityReference_SelectionHandler_Broken::getInstance($field, $instance); } // Check if the entity type does exist and has a base table. $entity_info = entity_get_info($target_entity_type); if (empty($entity_info['base table'])) { return EntityReference_SelectionHandler_Broken::getInstance($field, $instance); } return new EntityReference_SelectionHandler_Commerce_Store($field, $instance, $entity_type, $entity); }
/** * Implements EntityReferenceHandler::getInstance(). */ public static function getInstance($field, $instance = NULL, $entity_type = NULL, $entity = NULL) { $target_entity_type = $field['settings']['target_type']; // Check if the entity type does exist and has a base table. $entity_info = entity_get_info($target_entity_type); if (empty($entity_info['base table'])) { return EntityReference_SelectionHandler_Broken::getInstance($field, $instance); } if (class_exists($class_name = 'EntityReference_SelectionHandler_Generic_' . $target_entity_type)) { return new $class_name($field, $instance, $entity_type, $entity); } else { return new EntityReference_SelectionHandler_Generic($field, $instance, $entity_type, $entity); } }