portfolio.class.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?php
  2. namespace Portfolio;
  3. /**
  4. * Portfolio are used to display and share content. The porfolio class represents
  5. * one (external) portfolio application and allows to share content with an it.
  6. *
  7. * @copyright (c) 2012 University of Geneva
  8. * @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html
  9. * @author Laurent Opprecht <laurent@opprecht.info>
  10. */
  11. class Portfolio
  12. {
  13. public static function none()
  14. {
  15. static $result = null;
  16. if (empty($result)) {
  17. $result = new self('empty', null);
  18. }
  19. return $result;
  20. }
  21. public static function all()
  22. {
  23. }
  24. protected $name;
  25. protected $title = '';
  26. protected $description = '';
  27. protected $channel;
  28. function __construct($name, $channel = null)
  29. {
  30. $this->name = $name;
  31. $this->title = $name;
  32. $this->channel = $channel;
  33. }
  34. /**
  35. * The name of the portfolio - i.e. the unique id.
  36. * @return type
  37. */
  38. function get_name()
  39. {
  40. return $this->name;
  41. }
  42. /**
  43. * Title for the end user.
  44. *
  45. * @return type
  46. */
  47. function get_title()
  48. {
  49. return $this->title;
  50. }
  51. function set_title($value)
  52. {
  53. $this->title = $value;
  54. }
  55. /**
  56. * Description for the end user.
  57. *
  58. * @return type
  59. */
  60. function get_description()
  61. {
  62. return $this->description;
  63. }
  64. function set_description($value)
  65. {
  66. $this->description = $value;
  67. }
  68. /**
  69. *
  70. * @return HttpChannel
  71. */
  72. function channel()
  73. {
  74. return $this->channel;
  75. }
  76. function __toString()
  77. {
  78. return $this->name;
  79. }
  80. /**
  81. *
  82. * @param User $user
  83. * @param Artefact $artefact
  84. * @return bool
  85. */
  86. function send($user, $artefact)
  87. {
  88. return false;
  89. }
  90. }