C_Image

Model for NextGen Gallery Images.

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 extends C_DataMapper_Model 
  2. var $_mapper_interface = 'I_Image_Mapper'; 
  3. function define($properties = array(), $mapper = FALSE, $context = FALSE) 
  4. parent::define($mapper, $properties, $context); 
  5. $this->add_mixin('Mixin_NextGen_Gallery_Image_Validation'); 
  6. $this->implement('I_Image'); 
  7. /** 
  8. * Instantiates a new model 
  9. * @param array|stdClass $properties 
  10. * @param C_DataMapper $mapper 
  11. * @param string $context 
  12. */ 
  13. function initialize($properties = array(), $mapper = FALSE, $context = FALSE) 
  14. // Get the mapper is not specified 
  15. if (!$mapper) { 
  16. $mapper = $this->get_registry()->get_utility($this->_mapper_interface); 
  17. // Initialize 
  18. parent::initialize($mapper, $properties); 
  19. /** 
  20. * Returns the model representing the gallery associated with this image 
  21. * @return C_Gallery|stdClass 
  22. */ 
  23. function get_gallery($model = FALSE) 
  24. $gallery_mapper = C_Gallery_Mapper::get_instance(); 
  25. return $gallery_mapper->find($this->galleryid, $model);