*prechod na novsiu verziu ZF
[sport-group.git] / library / Zend / Tool / Framework / Action / Base.php
blobcbb4cb12c120a68615235add4a0b0361a07dcee1
1 <?php
2 /**
3 * Zend Framework
5 * LICENSE
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.
15 * @category Zend
16 * @package Zend_Tool
17 * @subpackage Framework
18 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license http://framework.zend.com/license/new-bsd New BSD License
20 * @version $Id: Base.php 16971 2009-07-22 18:05:45Z mikaelkael $
23 /**
24 * @see Zend_Tool_Framework_Action_Interface
26 require_once 'Zend/Tool/Framework/Action/Interface.php';
28 /**
29 * @category Zend
30 * @package Zend_Tool
31 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
32 * @license http://framework.zend.com/license/new-bsd New BSD License
34 class Zend_Tool_Framework_Action_Base implements Zend_Tool_Framework_Action_Interface
37 /**
38 * @var string
40 protected $_name = null;
42 /**
43 * constructor -
45 * @param unknown_type $options
47 public function __construct($options = null)
49 if ($options !== null) {
50 if (is_string($options)) {
51 $this->setName($options);
53 // implement $options here in the future if this is needed
57 /**
58 * setName()
60 * @param string $name
61 * @return Zend_Tool_Framework_Action_Base
63 public function setName($name)
65 $this->_name = $name;
66 return $this;
69 /**
70 * getName()
72 * @return string
74 public function getName()
76 if ($this->_name == null) {
77 $this->_name = $this->_parseName();
79 return $this->_name;
82 /**
83 * _parseName - internal method to determine the name of an action when one is not explicity provided.
85 * @param Zend_Tool_Framework_Action_Interface $action
86 * @return string
88 protected function _parseName()
90 $className = get_class($this);
91 $actionName = substr($className, strrpos($className, '_')+1);
92 return $actionName;