Library.php 964 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. class Application_Model_Library
  3. {
  4. public static function getObjInfo($p_type)
  5. {
  6. $info = array();
  7. if (strcmp($p_type, 'playlist')==0) {
  8. $info['className'] = 'Application_Model_Playlist';
  9. } elseif (strcmp($p_type, 'block')==0) {
  10. $info['className'] = 'Application_Model_Block';
  11. } elseif (strcmp($p_type, 'stream')==0) {
  12. $info['className'] = 'Application_Model_Webstream';
  13. } else {
  14. throw new Exception("Unknown object type: '$p_type'");
  15. }
  16. return $info;
  17. }
  18. public static function changePlaylist($p_id, $p_type)
  19. {
  20. $obj_sess = new Zend_Session_Namespace(UI_PLAYLISTCONTROLLER_OBJ_SESSNAME);
  21. if (is_null($p_id) || is_null($p_type)) {
  22. unset($obj_sess->id);
  23. unset($obj_sess->type);
  24. } else {
  25. $obj_sess->id = intval($p_id);
  26. $obj_sess->type = $p_type;
  27. }
  28. }
  29. }