SchemaReaderResourceTableField.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. Lib::loadClass('SchemaReaderResource');
  3. class SchemaReaderResourceTableField extends SchemaReaderResource {
  4. protected $_uri;
  5. private $_label;
  6. private $_description;
  7. private $_perms;
  8. private $_sort_prio;
  9. public function __construct($uri) {
  10. parent::__construct($uri);
  11. }
  12. public function parseIniConfig($configData) {
  13. $this->_label = V::get('label', '', $configData);
  14. $this->_description = V::get('description', '', $configData);
  15. $this->_perms = V::get('perms', '', $configData);
  16. $this->_sort_prio = V::get('sort_prio', 0, $configData, 'int');
  17. return true;
  18. }
  19. public function addPerms($perms) {
  20. $perms .= $this->_perms;
  21. $perms = str_split($perms);
  22. $perms = array_unique($perms);
  23. $perms = implode('', $perms);
  24. $this->_perms = $perms;
  25. }
  26. public function getTableName() {
  27. $uriParts = explode('/', $this->_uri);
  28. array_pop($uriParts);
  29. return array_pop($uriParts);
  30. }
  31. public function getTableUri() {
  32. $uriParts = explode('/', $this->_uri);
  33. array_pop($uriParts);
  34. return implode('/', $uriParts);
  35. }
  36. public function getLabel() { return $this->_label; }
  37. public function getDescription() { return $this->_description; }
  38. public function getPerms() { return $this->_perms; }
  39. public function getSortPrio() { return $this->_sort_prio; }
  40. }