Mixin_Album_Mapper

Provides album-specific methods for the datamapper.

Defined (1)

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

/products/photocrati_nextgen/modules/nextgen_data/package.module.nextgen_data.php  
  1. class Mixin_Album_Mapper extends Mixin 
  2. /** 
  3. * Gets the post title when the Custom Post driver is used 
  4. * @param C_DataMapper_Model|C_Album|stdClass $entity 
  5. * @return string 
  6. */ 
  7. function get_post_title($entity) 
  8. return $entity->name; 
  9. function _save_entity($entity) 
  10. $retval = $this->call_parent('_save_entity', $entity); 
  11. if ($retval) { 
  12. do_action('ngg_album_updated', $entity); 
  13. C_Photocrati_Transient_Manager::flush('displayed_gallery_rendering'); 
  14. return $retval; 
  15. /** 
  16. * Sets the defaults for an album 
  17. * @param C_DataMapper_Model|C_Album|stdClass $entity 
  18. */ 
  19. function set_defaults($entity) 
  20. $this->object->_set_default_value($entity, 'name', ''); 
  21. $this->object->_set_default_value($entity, 'albumdesc', ''); 
  22. $this->object->_set_default_value($entity, 'sortorder', array()); 
  23. $this->object->_set_default_value($entity, 'previewpic', 0); 
  24. $this->object->_set_default_value($entity, 'exclude', 0); 
  25. if (isset($entity->name) && !isset($entity->slug)) { 
  26. $entity->slug = nggdb::get_unique_slug(sanitize_title($entity->name), 'album');