fieldrenderer.class.inc.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. // Copyright (C) 2010-2016 Combodo SARL
  3. //
  4. // This file is part of iTop.
  5. //
  6. // iTop is free software; you can redistribute it and/or modify
  7. // it under the terms of the GNU Affero General Public License as published by
  8. // the Free Software Foundation, either version 3 of the License, or
  9. // (at your option) any later version.
  10. //
  11. // iTop is distributed in the hope that it will be useful,
  12. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. // GNU Affero General Public License for more details.
  15. //
  16. // You should have received a copy of the GNU Affero General Public License
  17. // along with iTop. If not, see <http://www.gnu.org/licenses/>
  18. namespace Combodo\iTop\Renderer;
  19. use \Combodo\iTop\Form\Field\Field;
  20. /**
  21. * Description of FieldRenderer
  22. *
  23. * @author Guillaume Lajarige <guillaume.lajarige@combodo.com>
  24. */
  25. abstract class FieldRenderer
  26. {
  27. protected $oField;
  28. protected $sEndpoint;
  29. /**
  30. * Default constructor
  31. *
  32. * @param \Combodo\iTop\Form\Field\Field $oField
  33. */
  34. public function __construct(Field $oField)
  35. {
  36. $this->oField = $oField;
  37. }
  38. /**
  39. *
  40. * @return string
  41. */
  42. public function GetEndpoint()
  43. {
  44. return $this->sEndpoint;
  45. }
  46. /**
  47. *
  48. * @param string $sEndpoint
  49. */
  50. public function SetEndpoint($sEndpoint)
  51. {
  52. $this->sEndpoint = $sEndpoint;
  53. }
  54. /**
  55. * Renders a Field as a RenderingOutput
  56. *
  57. * @return \Combodo\iTop\Renderer\RenderingOutput
  58. */
  59. abstract public function Render();
  60. }