Source for file ArrayLoader.php

Documentation is available at ArrayLoader.php

  1. <?php
  2.  
  3. /**
  4. * MVCnPHP - ArrayLoader.class.php
  5. *
  6. * This source file is subject to version 2.02 of the PHP license,
  7. * that is bundled with this package in the file LICENSE, and is
  8. * available at through the world-wide-web at
  9. * http://www.php.net/license/2_02.txt.
  10. * If you did not receive a copy of the PHP license and are unable to
  11. * obtain it through the world-wide-web, please send a note to
  12. * license@php.net so we can mail you a copy immediately.
  13. *
  14. * @author Tony Bibbs <tony@geeklog.net>
  15. * @copyright Tony Bibbs 2003
  16. * @package net.geeklog.mvc
  17. * @version $Id: ArrayLoader.class.php,v 1.3 2004/03/23 02:38:37 tony Exp $
  18. *
  19. */
  20.  
  21. /**
  22. * Base Loader class which does most of the work
  23. */
  24. require_once 'BaseLoader.class.php';
  25.  
  26. /**
  27. * This loader creates a mapping from an PHP array
  28. *
  29. * @author Tony Bibbs <tony@geeklog.net>
  30. * @package net.geeklog.mvc
  31. * @see LoaderFactory
  32. *
  33. */
  34. class MVCnPHP_ArrayLoader extends MVCnPHP_BaseLoader {
  35. /**
  36. * Gets config data for given object in the form of
  37. * a mapping object
  38. *
  39. * @author Tony Bibbs <tony@geeklog.net>
  40. * @access public
  41. * @param string $name Name of object to get mapping for
  42. * @param string $viewsDir Directory where controllers views are stored
  43. * @param string $commandsDir DIrectory where controllers commands are stored
  44. * @param string $baseURL Base URL, all redirects are relative to this URL
  45. * @param array $arrayData Array of configuration data
  46. * @return object Mapping object
  47. *
  48. */
  49. public function &getMapping($name, $viewsDir, $commandsDir, $baseURL, $arrayData = '')
  50. {
  51. if (!is_array($arrayData) AND !is_array($this->arrayData)) {
  52. return false;
  53. }
  54. if (empty($this->arrayData)) {
  55. $this->arrayData = $arrayData;
  56. }
  57. return parent::getMapping($name, $viewsDir, $commandsDir, $baseURL, $this->arrayData);
  58. }
  59. }
  60.  
  61. ?>

Documentation generated on Mon, 7 Mar 2005 22:36:19 -0600 by phpDocumentor 1.3.0RC3