aiccResource.class.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. *
  7. * @package chamilo.learnpath
  8. *
  9. * @author Yannick Warnier <ywarnier@beeznest.org>
  10. * @license GNU/GPL
  11. */
  12. class aiccResource
  13. {
  14. public $identifier = '';
  15. public $title = '';
  16. public $description = '';
  17. public $developer_id = '';
  18. /**
  19. * Class constructor. Depending of the type of construction called ('db' or 'manifest'), will create a scormResource
  20. * object from database records or from the array given as second param.
  21. *
  22. * @param string $type Type of construction needed ('db' or 'config', default = 'config')
  23. * @param mixed $params Depending on the type given, DB id for the lp_item or parameters array
  24. */
  25. public function __construct($type = 'config', $params)
  26. {
  27. if (isset($params)) {
  28. switch ($type) {
  29. case 'db':
  30. // TODO: Implement this way of object creation.
  31. break;
  32. case 'config': // Do the same as the default.
  33. default:
  34. foreach ($params as $a => $value) {
  35. switch ($a) {
  36. case 'system_id':
  37. $this->identifier = strtolower($value);
  38. break;
  39. case 'title':
  40. $this->title = $value;
  41. // no break - @todo check this, not sure the intention is to have description=title
  42. case 'description':
  43. $this->description = $value;
  44. break;
  45. case 'developer_id':
  46. $this->developer_id = $value;
  47. break;
  48. }
  49. }
  50. }
  51. }
  52. }
  53. }