web/lib/Zend/CodeGenerator/Php/Member/Abstract.php
changeset 64 162c1de6545a
parent 19 1c2f13fd785c
child 68 ecaf28ffe26e
equal deleted inserted replaced
63:5b37998e522e 64:162c1de6545a
       
     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_CodeGenerator
       
    17  * @subpackage PHP
       
    18  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
       
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
       
    20  * @version    $Id: Abstract.php 20096 2010-01-06 02:05:09Z bkarwin $
       
    21  */
       
    22 
       
    23 /**
       
    24  * @see Zend_CodeGenerator_Php_Abstract
       
    25  */
       
    26 require_once 'Zend/CodeGenerator/Php/Abstract.php';
       
    27 
       
    28 /**
       
    29  * @see Zend_CodeGenerator_Php_Abstract
       
    30  */
       
    31 require_once 'Zend/CodeGenerator/Php/Docblock.php';
       
    32 
       
    33 /**
       
    34  * @category   Zend
       
    35  * @package    Zend_CodeGenerator
       
    36  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
       
    37  * @license    http://framework.zend.com/license/new-bsd     New BSD License
       
    38  */
       
    39 abstract class Zend_CodeGenerator_Php_Member_Abstract extends Zend_CodeGenerator_Php_Abstract
       
    40 {
       
    41 
       
    42     /**#@+
       
    43      * @param const string
       
    44      */
       
    45     const VISIBILITY_PUBLIC    = 'public';
       
    46     const VISIBILITY_PROTECTED = 'protected';
       
    47     const VISIBILITY_PRIVATE   = 'private';
       
    48     /**#@-*/
       
    49 
       
    50     /**
       
    51      * @var Zend_CodeGenerator_Php_Docblock
       
    52      */
       
    53     protected $_docblock   = null;
       
    54 
       
    55     /**
       
    56      * @var bool
       
    57      */
       
    58     protected $_isAbstract = false;
       
    59 
       
    60     /**
       
    61      * @var bool
       
    62      */
       
    63     protected $_isFinal    = false;
       
    64 
       
    65     /**
       
    66      * @var bool
       
    67      */
       
    68     protected $_isStatic   = false;
       
    69 
       
    70     /**
       
    71      * @var const
       
    72      */
       
    73     protected $_visibility = self::VISIBILITY_PUBLIC;
       
    74 
       
    75     /**
       
    76      * @var string
       
    77      */
       
    78     protected $_name = null;
       
    79 
       
    80     /**
       
    81      * setDocblock() Set the docblock
       
    82      *
       
    83      * @param Zend_CodeGenerator_Php_Docblock|array|string $docblock
       
    84      * @return Zend_CodeGenerator_Php_File
       
    85      */
       
    86     public function setDocblock($docblock)
       
    87     {
       
    88         if (is_string($docblock)) {
       
    89             $docblock = array('shortDescription' => $docblock);
       
    90         }
       
    91 
       
    92         if (is_array($docblock)) {
       
    93             $docblock = new Zend_CodeGenerator_Php_Docblock($docblock);
       
    94         } elseif (!$docblock instanceof Zend_CodeGenerator_Php_Docblock) {
       
    95             require_once 'Zend/CodeGenerator/Php/Exception.php';
       
    96             throw new Zend_CodeGenerator_Php_Exception('setDocblock() is expecting either a string, array or an instance of Zend_CodeGenerator_Php_Docblock');
       
    97         }
       
    98 
       
    99         $this->_docblock = $docblock;
       
   100         return $this;
       
   101     }
       
   102 
       
   103     /**
       
   104      * getDocblock()
       
   105      *
       
   106      * @return Zend_CodeGenerator_Php_Docblock
       
   107      */
       
   108     public function getDocblock()
       
   109     {
       
   110         return $this->_docblock;
       
   111     }
       
   112 
       
   113     /**
       
   114      * setAbstract()
       
   115      *
       
   116      * @param bool $isAbstract
       
   117      * @return Zend_CodeGenerator_Php_Member_Abstract
       
   118      */
       
   119     public function setAbstract($isAbstract)
       
   120     {
       
   121         $this->_isAbstract = ($isAbstract) ? true : false;
       
   122         return $this;
       
   123     }
       
   124 
       
   125     /**
       
   126      * isAbstract()
       
   127      *
       
   128      * @return bool
       
   129      */
       
   130     public function isAbstract()
       
   131     {
       
   132         return $this->_isAbstract;
       
   133     }
       
   134 
       
   135     /**
       
   136      * setFinal()
       
   137      *
       
   138      * @param bool $isFinal
       
   139      * @return Zend_CodeGenerator_Php_Member_Abstract
       
   140      */
       
   141     public function setFinal($isFinal)
       
   142     {
       
   143         $this->_isFinal = ($isFinal) ? true : false;
       
   144         return $this;
       
   145     }
       
   146 
       
   147     /**
       
   148      * isFinal()
       
   149      *
       
   150      * @return bool
       
   151      */
       
   152     public function isFinal()
       
   153     {
       
   154         return $this->_isFinal;
       
   155     }
       
   156 
       
   157     /**
       
   158      * setStatic()
       
   159      *
       
   160      * @param bool $isStatic
       
   161      * @return Zend_CodeGenerator_Php_Member_Abstract
       
   162      */
       
   163     public function setStatic($isStatic)
       
   164     {
       
   165         $this->_isStatic = ($isStatic) ? true : false;
       
   166         return $this;
       
   167     }
       
   168 
       
   169     /**
       
   170      * isStatic()
       
   171      *
       
   172      * @return bool
       
   173      */
       
   174     public function isStatic()
       
   175     {
       
   176         return $this->_isStatic;
       
   177     }
       
   178 
       
   179     /**
       
   180      * setVisitibility()
       
   181      *
       
   182      * @param const $visibility
       
   183      * @return Zend_CodeGenerator_Php_Member_Abstract
       
   184      */
       
   185     public function setVisibility($visibility)
       
   186     {
       
   187         $this->_visibility = $visibility;
       
   188         return $this;
       
   189     }
       
   190 
       
   191     /**
       
   192      * getVisibility()
       
   193      *
       
   194      * @return const
       
   195      */
       
   196     public function getVisibility()
       
   197     {
       
   198         return $this->_visibility;
       
   199     }
       
   200 
       
   201     /**
       
   202      * setName()
       
   203      *
       
   204      * @param string $name
       
   205      * @return Zend_CodeGenerator_Php_Member_Abstract
       
   206      */
       
   207     public function setName($name)
       
   208     {
       
   209         $this->_name = $name;
       
   210         return $this;
       
   211     }
       
   212 
       
   213     /**
       
   214      * getName()
       
   215      *
       
   216      * @return string
       
   217      */
       
   218     public function getName()
       
   219     {
       
   220         return $this->_name;
       
   221     }
       
   222 }