You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
1.8 KiB

  1. <?php
  2. /*
  3. This file is part of ActiveLink PHP XML Package (www.active-link.com).
  4. Copyright (c) 2002-2004 by Zurab Davitiani
  5. You can contact the author of this software via E-mail at
  6. hattrick@mailcan.com
  7. ActiveLink PHP XML Package is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU Lesser General Public License as published by
  9. the Free Software Foundation; either version 2.1 of the License, or
  10. (at your option) any later version.
  11. ActiveLink PHP XML Package 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 Lesser General Public License for more details.
  15. You should have received a copy of the GNU Lesser General Public License
  16. along with ActiveLink PHP XML Package; if not, write to the Free Software
  17. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. */
  19. /*
  20. * requires XML class
  21. */
  22. import("org.active-link.xml.XML");
  23. /**
  24. * XMLBranch class provides a tree-like structure to read/write/modify XML
  25. * @class XMLBranch
  26. * @package org.active-link.xml
  27. * @author Zurab Davitiani
  28. * @version 0.4.0
  29. * @extends XML
  30. * @requires XML
  31. * @see Tree
  32. */
  33. class XMLBranch extends XML {
  34. var $parentXML;
  35. /**
  36. * Gets parent object of the XML branch
  37. * @method getParentXML
  38. * @returns parent object of the XML branch
  39. */
  40. function getParentXML() {
  41. return $this->parentXML;
  42. }
  43. /**
  44. * Sets parent object of the XML branch
  45. * @method setParentXML
  46. * @param object xml
  47. * @returns true if successful, false otherwise
  48. */
  49. function setParentXML(&$xml) {
  50. $success = false;
  51. if(strtolower(get_class($xml)) == "xml" || strtolower(get_class($xml)) == "xmlbranch") {
  52. $this->parentXML = &$xml;
  53. $success = true;
  54. }
  55. return $success;
  56. }
  57. }
  58. ?>