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.
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 $
24 * @see Zend_Tool_Framework_Action_Interface
26 require_once 'Zend/Tool/Framework/Action/Interface.php';
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
40 protected $_name = null;
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
61 * @return Zend_Tool_Framework_Action_Base
63 public function setName($name)
74 public function getName()
76 if ($this->_name
== null) {
77 $this->_name
= $this->_parseName();
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
88 protected function _parseName()
90 $className = get_class($this);
91 $actionName = substr($className, strrpos($className, '_')+
1);