aiccResource.class.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Class defining the elements from an AICC Descriptor file.
  5. * Container for the aiccResource class that deals with elemens from AICC Descriptor file
  6. * @package chamilo.learnpath
  7. * @author Yannick Warnier <ywarnier@beeznest.org>
  8. * @license GNU/GPL
  9. */
  10. class aiccResource
  11. {
  12. public $identifier = '';
  13. public $title = '';
  14. public $description = '';
  15. public $developer_id = '';
  16. /**
  17. * Class constructor. Depending of the type of construction called ('db' or 'manifest'), will create a scormResource
  18. * object from database records or from the array given as second param
  19. * @param string Type of construction needed ('db' or 'config', default = 'config')
  20. * @param mixed Depending on the type given, DB id for the lp_item or parameters array
  21. */
  22. public function aiccResource($type = 'config', $params)
  23. {
  24. if (isset($params)) {
  25. switch ($type) {
  26. case 'db':
  27. // TODO: Implement this way of object creation.
  28. return false;
  29. case 'config': // Do the same as the default.
  30. default:
  31. foreach ($params as $a => $value) {
  32. switch ($a) {
  33. case 'system_id':
  34. $this->identifier = strtolower($value);
  35. break;
  36. case 'title':
  37. $this->title = $value;
  38. case 'description':
  39. $this->description = $value;
  40. break;
  41. case 'developer_id':
  42. $this->developer_id = $value;
  43. break;
  44. }
  45. }
  46. return true;
  47. }
  48. }
  49. return false;
  50. }
  51. }