aiccResource.class.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 Type of construction needed ('db' or 'config', default = 'config')
  20. * @param mixed $params Depending on the type given, DB id for the lp_item or parameters array
  21. */
  22. public function __construct($type = 'config', $params)
  23. {
  24. if (isset($params)) {
  25. switch ($type) {
  26. case 'db':
  27. // TODO: Implement this way of object creation.
  28. break;
  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. // no break - @todo check this, not sure the intention is to have description=title
  39. case 'description':
  40. $this->description = $value;
  41. break;
  42. case 'developer_id':
  43. $this->developer_id = $value;
  44. break;
  45. }
  46. }
  47. }
  48. }
  49. }
  50. }