C_Display_Type_Mapper

Provides a datamapper to perform CRUD operations for Display Types.

Defined (1)

The class is defined in the following location(s).

/products/photocrati_nextgen/modules/nextgen_gallery_display/package.module.nextgen_gallery_display.php  
  1. class C_Display_Type_Mapper extends C_CustomPost_DataMapper_Driver 
  2. public static $_instances = array(); 
  3. function define($context = FALSE, $not_used = FALSE) 
  4. $object_name = 'display_type'; 
  5. // Add the object name to the context of the object as well 
  6. // This allows us to adapt the driver itself, if required 
  7. if (!is_array($context)) { 
  8. $context = array($context); 
  9. array_push($context, $object_name); 
  10. parent::define($object_name, $context); 
  11. $this->add_mixin('Mixin_Display_Type_Mapper'); 
  12. $this->implement('I_Display_Type_Mapper'); 
  13. $this->set_model_factory_method($object_name); 
  14. // Define columns 
  15. $this->define_column('ID', 'BIGINT', 0); 
  16. $this->define_column('name', 'VARCHAR(255)'); 
  17. $this->define_column('title', 'VARCHAR(255)'); 
  18. $this->define_column('preview_image_relpath', 'VARCHAR(255)'); 
  19. $this->define_column('default_source', 'VARCHAR(255)'); 
  20. $this->define_column('view_order', 'BIGINT', NGG_DISPLAY_PRIORITY_BASE); 
  21. $this->add_serialized_column('settings'); 
  22. $this->add_serialized_column('entity_types'); 
  23. function initialize($context = FALSE) 
  24. parent::initialize('display_type'); 
  25. /** 
  26. * Gets a singleton of the mapper 
  27. * @param string|array $context 
  28. * @return C_Display_Type_Mapper 
  29. */ 
  30. public static function get_instance($context = False) 
  31. if (!isset(self::$_instances[$context])) { 
  32. self::$_instances[$context] = new C_Display_Type_Mapper($context); 
  33. return self::$_instances[$context];