C_Gallery

Creates a model representing a NextGEN Gallery object.

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 extends C_DataMapper_Model 
  2. var $_mapper_interface = 'I_Gallery_Mapper'; 
  3. /** 
  4. * Defines the interfaces and methods (through extensions and hooks) 
  5. * that this class provides 
  6. */ 
  7. function define($properties = array(), $mapper = FALSE, $context = FALSE) 
  8. parent::define($mapper, $properties, $context); 
  9. $this->add_mixin('Mixin_NextGen_Gallery_Validation'); 
  10. $this->implement('I_Gallery'); 
  11. /** 
  12. * Instantiates a new model 
  13. * @param array|stdClass $properties 
  14. * @param C_DataMapper $mapper 
  15. * @param string $context 
  16. */ 
  17. function initialize($properties = array(), $mapper = FALSE, $context = FALSE) 
  18. // Get the mapper is not specified 
  19. if (!$mapper) { 
  20. $mapper = $this->get_registry()->get_utility($this->_mapper_interface); 
  21. // Initialize 
  22. parent::initialize($mapper, $properties); 
  23. function get_images() 
  24. $mapper = C_Image_Mapper::get_instance(); 
  25. return $mapper->select()->where(array('galleryid = %d', $this->gid))->order_by('sortorder')->run_query();