Documentation is available at Mapping.php
- <?php
- /**
- * MVCnPHP - Mapping.class.php
- *
- * This source file is subject to version 2.02 of the PHP license,
- * that is bundled with this package in the file LICENSE, and is
- * available at through the world-wide-web at
- * http://www.php.net/license/2_02.txt.
- * If you did not receive a copy of the PHP license and are unable to
- * obtain it through the world-wide-web, please send a note to
- * license@php.net so we can mail you a copy immediately.
- *
- * @author Tony Bibbs <tony@geeklog.net>
- * @copyright Tony Bibbs 2003
- * @package net.geeklog.mvc
- * @version $Id: Mapping.class.php,v 1.2 2003/08/28 01:31:22 tony Exp $
- *
- */
- /**
- * This is the mapping object. This holds all pertinent mapping data for
- * a specific model or view. NOTE: not all available mappings are loaded
- * for each request, only those needed for the current request.
- *
- * @author Tony Bibbs <tony@geeklog.net>
- * @package net.geeklog.mvc
- *
- */
- class MVCnPHP_Mapping {
- /**
- * @access private
- * @var string
- */
- private $name = null;
- /**
- * @access private
- * @var string
- */
- private $type = null;
- /**
- * @access private
- * @var string
- */
- private $typePath = null;
- /**
- * @access private
- * @var string
- */
- private $forwards = null;
- /**
- * @access private
- * @var string
- */
- private $baseURL = null;
- /**
- * Sets the base URL for any redirects
- *
- * @author Tony Bibbs <tony@geeklog.net>
- * @access public
- * @param string $url Base url for all redirects
- *
- */
- public function setBaseURL($url)
- {
- $this->baseURL = $url;
- }
- /**
- * Gets the base URL for any redirects
- * Any forwards to other URL's must be relative to the
- * base URL provided
- *
- * @author Tony Bibbs <tony@geeklog.net>
- * @access public
- * @return string Base url
- *
- */
- public function getBaseURL()
- {
- return $this->baseURL;
- }
- /**
- * Sets the name for the model or view this mapping
- * belongs to.
- *
- * @author Tony Bibbs <tony@geeklog.net>
- * @access public
- * @param string $name Name of model or view
- *
- */
- public function setName($name)
- {
- $this->name = $name;
- }
- /**
- * Gets the name for the model or view this mapping
- * belongs to.
- *
- * @author Tony Bibbs <tony@geeklog.net>
- * @access public
- * @return string Name of the model or view
- *
- */
- public function getName()
- {
- return $this->name;
- }
- /**
- * Sets the type of object this mapping belongs to (model or view)
- *
- * @author Tony Bibbs <tony@geeklog.net>
- * @access public
- * @param string $type Type of object (model or view)
- *
- */
- public function setType($type)
- {
- $this->type = $type;
- }
- /**
- * Gets the type of object this mapping belongs to (model or view)
- *
- * @author Tony Bibbs <tony@geeklog.net>
- * @access public
- * @return string Type of object (model or view)
- *
- */
- public function getType()
- {
- return $this->type;
- }
- /**
- * Sets all forwards associated with this mapping. Note
- * that you won't have forwards for any views
- *
- * @author Tony Bibbs <tony@geeklog.net>
- * @access public
- * @param array $forwards Array of forwards tied to this object
- *
- */
- public function setForwards($forwards)
- {
- $this->forwards = $forwards;
- }
- public function getForwards()
- {
- return $this->forwards;
- }
- /**
- * Retrieves the requested forward
- *
- * @author Tony Bibbs <tony@geeklog.net>
- * @access public
- * @param string $name Name of forward to get
- * @return array|booleanThe forward data or false if not found
- *
- */
- public function getForward($name)
- {
- if (!empty($this->forwards[$name])) {
- return $this->forwards[$name];
- } else {
- return false;
- }
- }
- /**
- * Sets the path where the models or views can be found
- *
- * @author Tony Bibbs <tony@geeklog.net>
- * @access public
- * @param string $path Absolute path ending with trailing slash
- *
- */
- public function setTypePath($path)
- {
- $this->typePath = $path;
- }
- /**
- * Gets the absolute path where the code for this model or view this
- * mapping belongs to can be found
- *
- * @author Tony Bibbs <tony@geeklog.net>
- * @access public
- * @return string Path to model or view directory
- *
- */
- public function getPath()
- {
- return $this->typePath;
- }
- }
- ?>
Documentation generated on Mon, 7 Mar 2005 22:36:22 -0600 by phpDocumentor 1.3.0RC3