aiccObjective.class.php 2.0 KB

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