SproutCMS

This is the code documentation for the SproutCMS project

source of /sprout/Helpers/RteLibObject.php

  1. <?php
  2. /*
  3.  * Copyright (C) 2017 Karmabunny Pty Ltd.
  4.  *
  5.  * This file is a part of SproutCMS.
  6.  *
  7.  * SproutCMS is free software: you can redistribute it and/or modify it under the terms
  8.  * of the GNU General Public License as published by the Free Software Foundation, either
  9.  * version 2 of the License, or (at your option) any later version.
  10.  *
  11.  * For more information, visit <http://getsproutcms.com>.
  12.  */
  13.  
  14. namespace Sprout\Helpers;
  15.  
  16. /**
  17. * Returned by RteLibrary classes to represent a "object" (e.g. files) in the browse structure
  18. **/
  19. class RteLibObject
  20. {
  21. private $name;
  22. private $label;
  23. private $attrs;
  24. private $props;
  25.  
  26.  
  27. public function __construct($name, $label, $attrs, $props)
  28. {
  29. $this->name = $name;
  30. $this->label = $label;
  31. $this->attrs = $attrs;
  32. $this->props = $props;
  33. }
  34.  
  35. public function getName()
  36. {
  37. return $this->name;
  38. }
  39.  
  40. public function getLabel()
  41. {
  42. return $this->label;
  43. }
  44.  
  45. public function getAttrs()
  46. {
  47. return $this->attrs;
  48. }
  49.  
  50. public function getProps()
  51. {
  52. return $this->props;
  53. }
  54.  
  55. public function getIconClass()
  56. {
  57. return !empty($this->props['icon']) ? $this->props['icon'] : 'object';
  58. }
  59. }
  60.