C_Image_Mapper

Class C_Image_Mapper.

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_Image_Mapper extends C_CustomTable_DataMapper_Driver 
  2. public static $_instance = NULL; 
  3. /** 
  4. * Defines the gallery image mapper 
  5. * @param type $context 
  6. */ 
  7. public function define($context = FALSE, $not_used = FALSE) 
  8. // Add 'attachment' context 
  9. if (!is_array($context)) { 
  10. $context = array($context); 
  11. array_push($context, 'attachment'); 
  12. // Define the mapper 
  13. $this->_primary_key_column = 'pid'; 
  14. parent::define('ngg_pictures', $context); 
  15. $this->add_mixin('Mixin_NextGen_Table_Extras'); 
  16. $this->add_mixin('Mixin_Gallery_Image_Mapper'); 
  17. $this->implement('I_Image_Mapper'); 
  18. $this->set_model_factory_method('image'); 
  19. // Define the columns 
  20. $this->define_column('pid', 'BIGINT', 0); 
  21. $this->define_column('image_slug', 'VARCHAR(255)'); 
  22. $this->define_column('post_id', 'BIGINT', 0); 
  23. $this->define_column('galleryid', 'BIGINT', 0); 
  24. $this->define_column('filename', 'VARCHAR(255)'); 
  25. $this->define_column('description', 'TEXT'); 
  26. $this->define_column('alttext', 'TEXT'); 
  27. $this->define_column('imagedate', 'DATETIME'); 
  28. $this->define_column('exclude', 'INT', 0); 
  29. $this->define_column('sortorder', 'BIGINT', 0); 
  30. $this->define_column('meta_data', 'TEXT'); 
  31. $this->define_column('extras_post_id', 'BIGINT', 0); 
  32. $this->define_column('updated_at', 'BIGINT'); 
  33. // Mark the columns which should be unserialized 
  34. $this->add_serialized_column('meta_data'); 
  35. public function initialize($object_name = FALSE) 
  36. parent::initialize('ngg_pictures'); 
  37. static function get_instance($context = False) 
  38. if (is_null(self::$_instance)) { 
  39. $klass = get_class(); 
  40. self::$_instance = new $klass($context); 
  41. return self::$_instance;