aiccObjective.class.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. }