1 <?php 2 /** 3 * Zend Framework 4 * 5 * LICENSE 6 * 7 * This source file is subject to the new BSD license that is bundled 8 * with this package in the file LICENSE.txt. 9 * It is also available through the world-wide-web at this URL: 10 * http://framework.zend.com/license/new-bsd 11 * If you did not receive a copy of the license and are unable to 12 * obtain it through the world-wide-web, please send an email 13 * to license@zend.com so we can send you a copy immediately. 14 * 15 * @category Zend 16 * @package Zend_Controller 17 * @subpackage Router 18 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 19 * @version $Id$ 20 * @license http://framework.zend.com/license/new-bsd New BSD License 21 */ 22 23 /** 24 * @see Zend_Controller_Router_Route_Interface 25 */ 26 27 /** 28 * Abstract Route 29 * 30 * Implements interface and provides convenience methods 31 * 32 * @package Zend_Controller 33 * @subpackage Router 34 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 35 * @license http://framework.zend.com/license/new-bsd New BSD License 36 */ 37 abstract class Zend_Controller_Router_Route_Abstract implements Zend_Controller_Router_Route_Interface 38 { 39 /** 40 * URI delimiter 41 */ 42 const URI_DELIMITER = '/'; 43 44 /** 45 * Wether this route is abstract or not 46 * 47 * @var boolean 48 */ 49 protected $_isAbstract = false; 50 51 /** 52 * Path matched by this route 53 * 54 * @var string 55 */ 56 protected $_matchedPath = null; 57 58 /** 59 * Get the version of the route 60 * 61 * @return integer 62 */ 63 public function getVersion() 64 { 65 return 2; 66 } 67 68 /** 69 * Set partially matched path 70 * 71 * @param string $path 72 * @return void 73 */ 74 public function setMatchedPath($path) 75 { 76 $this->_matchedPath = $path; 77 } 78 79 /** 80 * Get partially matched path 81 * 82 * @return string 83 */ 84 public function getMatchedPath() 85 { 86 return $this->_matchedPath; 87 } 88 89 /** 90 * Check or set wether this is an abstract route or not 91 * 92 * @param boolean $flag 93 * @return boolean 94 */ 95 public function isAbstract($flag = null) 96 { 97 if ($flag !== null) { 98 $this->_isAbstract = $flag; 99 } 100 101 return $this->_isAbstract; 102 } 103 104 /** 105 * Create a new chain 106 * 107 * @param Zend_Controller_Router_Route_Abstract $route 108 * @param string $separator 109 * @return Zend_Controller_Router_Route_Chain 110 */ 111 public function chain(Zend_Controller_Router_Route_Abstract $route, $separator = '/') 112 { 113 114 $chain = new Zend_Controller_Router_Route_Chain(); 115 $chain->chain($this)->chain($route, $separator); 116 117 return $chain; 118 } 119 }