C_Gallery_Mapper

Provides a datamapper for galleries.

Defined (1)

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

/products/photocrati_nextgen/modules/nextgen_data/package.module.nextgen_data.php  
  1. class C_Gallery_Mapper extends C_CustomTable_DataMapper_Driver 
  2. public static $_instance = NULL; 
  3. /** 
  4. * Define the object 
  5. * @param string $context 
  6. */ 
  7. function define($context = FALSE, $not_used = FALSE) 
  8. // Add 'gallery' context 
  9. if (!is_array($context)) { 
  10. $context = array($context); 
  11. array_push($context, 'gallery'); 
  12. $this->_primary_key_column = 'gid'; 
  13. // Continue defining the object 
  14. parent::define('ngg_gallery', $context); 
  15. $this->set_model_factory_method('gallery'); 
  16. $this->add_mixin('Mixin_NextGen_Table_Extras'); 
  17. $this->add_mixin('Mixin_Gallery_Mapper'); 
  18. $this->implement('I_Gallery_Mapper'); 
  19. // Define the columns 
  20. $this->define_column('gid', 'BIGINT', 0); 
  21. $this->define_column('name', 'VARCHAR(255)'); 
  22. $this->define_column('slug', 'VARCHAR(255)'); 
  23. $this->define_column('path', 'TEXT'); 
  24. $this->define_column('title', 'TEXT'); 
  25. $this->define_column('pageid', 'INT', 0); 
  26. $this->define_column('previewpic', 'INT', 0); 
  27. $this->define_column('author', 'INT', 0); 
  28. $this->define_column('extras_post_id', 'BIGINT', 0); 
  29. function initialize($object_name = FALSE) 
  30. parent::initialize('ngg_gallery'); 
  31. /** 
  32. * Returns a singleton of the gallery mapper 
  33. * @param string $context 
  34. * @return C_Gallery_Mapper 
  35. */ 
  36. public static function get_instance($context = False) 
  37. if (is_null(self::$_instance)) { 
  38. $klass = get_class(); 
  39. self::$_instance = new $klass($context); 
  40. return self::$_instance;