File indexing completed on 2025-01-19 05:20:58
0001 <?php 0002 /** 0003 * Zend Framework 0004 * 0005 * LICENSE 0006 * 0007 * This source file is subject to the new BSD license that is bundled 0008 * with this package in the file LICENSE.txt. 0009 * It is also available through the world-wide-web at this URL: 0010 * http://framework.zend.com/license/new-bsd 0011 * If you did not receive a copy of the license and are unable to 0012 * obtain it through the world-wide-web, please send an email 0013 * to license@zend.com so we can send you a copy immediately. 0014 * 0015 * @category Zend 0016 * @package Zend_CodeGenerator 0017 * @subpackage PHP 0018 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0019 * @license http://framework.zend.com/license/new-bsd New BSD License 0020 * @version $Id$ 0021 */ 0022 0023 /** 0024 * @see Zend_CodeGenerator_Php_Abstract 0025 */ 0026 // require_once 'Zend/CodeGenerator/Php/Abstract.php'; 0027 0028 /** 0029 * @see Zend_CodeGenerator_Php_Abstract 0030 */ 0031 // require_once 'Zend/CodeGenerator/Php/Docblock.php'; 0032 0033 /** 0034 * @category Zend 0035 * @package Zend_CodeGenerator 0036 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0037 * @license http://framework.zend.com/license/new-bsd New BSD License 0038 */ 0039 abstract class Zend_CodeGenerator_Php_Member_Abstract extends Zend_CodeGenerator_Php_Abstract 0040 { 0041 0042 /**#@+ 0043 * @param const string 0044 */ 0045 const VISIBILITY_PUBLIC = 'public'; 0046 const VISIBILITY_PROTECTED = 'protected'; 0047 const VISIBILITY_PRIVATE = 'private'; 0048 /**#@-*/ 0049 0050 /** 0051 * @var Zend_CodeGenerator_Php_Docblock 0052 */ 0053 protected $_docblock = null; 0054 0055 /** 0056 * @var bool 0057 */ 0058 protected $_isAbstract = false; 0059 0060 /** 0061 * @var bool 0062 */ 0063 protected $_isFinal = false; 0064 0065 /** 0066 * @var bool 0067 */ 0068 protected $_isStatic = false; 0069 0070 /** 0071 * @var const 0072 */ 0073 protected $_visibility = self::VISIBILITY_PUBLIC; 0074 0075 /** 0076 * @var string 0077 */ 0078 protected $_name = null; 0079 0080 /** 0081 * setDocblock() Set the docblock 0082 * 0083 * @param Zend_CodeGenerator_Php_Docblock|array|string $docblock 0084 * @return Zend_CodeGenerator_Php_File 0085 */ 0086 public function setDocblock($docblock) 0087 { 0088 if (is_string($docblock)) { 0089 $docblock = array('shortDescription' => $docblock); 0090 } 0091 0092 if (is_array($docblock)) { 0093 $docblock = new Zend_CodeGenerator_Php_Docblock($docblock); 0094 } elseif (!$docblock instanceof Zend_CodeGenerator_Php_Docblock) { 0095 // require_once 'Zend/CodeGenerator/Php/Exception.php'; 0096 throw new Zend_CodeGenerator_Php_Exception('setDocblock() is expecting either a string, array or an instance of Zend_CodeGenerator_Php_Docblock'); 0097 } 0098 0099 $this->_docblock = $docblock; 0100 return $this; 0101 } 0102 0103 /** 0104 * getDocblock() 0105 * 0106 * @return Zend_CodeGenerator_Php_Docblock 0107 */ 0108 public function getDocblock() 0109 { 0110 return $this->_docblock; 0111 } 0112 0113 /** 0114 * setAbstract() 0115 * 0116 * @param bool $isAbstract 0117 * @return Zend_CodeGenerator_Php_Member_Abstract 0118 */ 0119 public function setAbstract($isAbstract) 0120 { 0121 $this->_isAbstract = ($isAbstract) ? true : false; 0122 return $this; 0123 } 0124 0125 /** 0126 * isAbstract() 0127 * 0128 * @return bool 0129 */ 0130 public function isAbstract() 0131 { 0132 return $this->_isAbstract; 0133 } 0134 0135 /** 0136 * setFinal() 0137 * 0138 * @param bool $isFinal 0139 * @return Zend_CodeGenerator_Php_Member_Abstract 0140 */ 0141 public function setFinal($isFinal) 0142 { 0143 $this->_isFinal = ($isFinal) ? true : false; 0144 return $this; 0145 } 0146 0147 /** 0148 * isFinal() 0149 * 0150 * @return bool 0151 */ 0152 public function isFinal() 0153 { 0154 return $this->_isFinal; 0155 } 0156 0157 /** 0158 * setStatic() 0159 * 0160 * @param bool $isStatic 0161 * @return Zend_CodeGenerator_Php_Member_Abstract 0162 */ 0163 public function setStatic($isStatic) 0164 { 0165 $this->_isStatic = ($isStatic) ? true : false; 0166 return $this; 0167 } 0168 0169 /** 0170 * isStatic() 0171 * 0172 * @return bool 0173 */ 0174 public function isStatic() 0175 { 0176 return $this->_isStatic; 0177 } 0178 0179 /** 0180 * setVisitibility() 0181 * 0182 * @param const $visibility 0183 * @return Zend_CodeGenerator_Php_Member_Abstract 0184 */ 0185 public function setVisibility($visibility) 0186 { 0187 $this->_visibility = $visibility; 0188 return $this; 0189 } 0190 0191 /** 0192 * getVisibility() 0193 * 0194 * @return const 0195 */ 0196 public function getVisibility() 0197 { 0198 return $this->_visibility; 0199 } 0200 0201 /** 0202 * setName() 0203 * 0204 * @param string $name 0205 * @return Zend_CodeGenerator_Php_Member_Abstract 0206 */ 0207 public function setName($name) 0208 { 0209 $this->_name = $name; 0210 return $this; 0211 } 0212 0213 /** 0214 * getName() 0215 * 0216 * @return string 0217 */ 0218 public function getName() 0219 { 0220 return $this->_name; 0221 } 0222 }