C_Album_Mapper

Class C_Album_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_Album_Mapper extends C_CustomTable_DataMapper_Driver 
  2. static $_instance = NULL; 
  3. function initialize($object_name = FALSE) 
  4. parent::initialize('ngg_album'); 
  5. function define($context = FALSE, $not_used = FALSE) 
  6. // Define the context 
  7. if (!is_array($context)) { 
  8. $context = array($context); 
  9. array_push($context, 'album'); 
  10. $this->_primary_key_column = 'id'; 
  11. // Define the mapper 
  12. parent::define('ngg_album', $context); 
  13. $this->add_mixin('Mixin_NextGen_Table_Extras'); 
  14. $this->add_mixin('Mixin_Album_Mapper'); 
  15. $this->implement('I_Album_Mapper'); 
  16. $this->set_model_factory_method('album'); 
  17. // Define the columns 
  18. $this->define_column('id', 'BIGINT', 0); 
  19. $this->define_column('name', 'VARCHAR(255)'); 
  20. $this->define_column('slug', 'VARCHAR(255'); 
  21. $this->define_column('previewpic', 'BIGINT', 0); 
  22. $this->define_column('albumdesc', 'TEXT'); 
  23. $this->define_column('sortorder', 'TEXT'); 
  24. $this->define_column('pageid', 'BIGINT', 0); 
  25. $this->define_column('extras_post_id', 'BIGINT', 0); 
  26. // Mark the columns which should be unserialized 
  27. $this->add_serialized_column('sortorder'); 
  28. /** 
  29. * Returns an instance of the album datamapper 
  30. * @param bool|mixed $context 
  31. * @return C_Album_Mapper 
  32. */ 
  33. static function get_instance($context = FALSE) 
  34. if (is_null(self::$_instance)) { 
  35. $klass = get_class(); 
  36. self::$_instance = new $klass($context); 
  37. return self::$_instance;