Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationDI
      • ApplicationLatte
      • ApplicationTracy
      • CacheDI
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsDI
      • FormsLatte
      • Framework
      • HttpDI
      • HttpTracy
      • MailDI
      • ReflectionDI
      • SecurityDI
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Conventions
      • Drivers
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
    • Reflection
    • Security
    • Utils
  • none
  • Tracy
    • Bridges
      • Nette

Classes

  • ClassType
  • Constant
  • Factory
  • Helpers
  • Member
  • Method
  • Parameter
  • PhpFile
  • PhpLiteral
  • PhpNamespace
  • Property
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  1: <?php
  2: 
  3: /**
  4:  * This file is part of the Nette Framework (https://nette.org)
  5:  * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
  6:  */
  7: 
  8: namespace Nette\PhpGenerator;
  9: 
 10: use Nette;
 11: 
 12: 
 13: /**
 14:  * Class member.
 15:  */
 16: abstract class Member
 17: {
 18:     use Nette\SmartObject;
 19: 
 20:     /** @var string */
 21:     private $name;
 22: 
 23:     /** @var string|NULL  public|protected|private */
 24:     private $visibility;
 25: 
 26:     /** @var string|NULL */
 27:     private $comment;
 28: 
 29: 
 30:     /**
 31:      * @param  string
 32:      */
 33:     public function __construct($name = '')
 34:     {
 35:         $this->setName($name);
 36:     }
 37: 
 38: 
 39:     /** @deprecated */
 40:     public function setName($name)
 41:     {
 42:         $this->name = (string) $name;
 43:         return $this;
 44:     }
 45: 
 46: 
 47:     /**
 48:      * @return string
 49:      */
 50:     public function getName()
 51:     {
 52:         return $this->name;
 53:     }
 54: 
 55: 
 56:     /**
 57:      * @param  string|NULL  public|protected|private
 58:      * @return static
 59:      */
 60:     public function setVisibility($val)
 61:     {
 62:         if (!in_array($val, ['public', 'protected', 'private', NULL], TRUE)) {
 63:             throw new Nette\InvalidArgumentException('Argument must be public|protected|private.');
 64:         }
 65:         $this->visibility = $val;
 66:         return $this;
 67:     }
 68: 
 69: 
 70:     /**
 71:      * @return string|NULL
 72:      */
 73:     public function getVisibility()
 74:     {
 75:         return $this->visibility;
 76:     }
 77: 
 78: 
 79:     /**
 80:      * @param  string|NULL
 81:      * @return static
 82:      */
 83:     public function setComment($val)
 84:     {
 85:         $this->comment = $val ? (string) $val : NULL;
 86:         return $this;
 87:     }
 88: 
 89: 
 90:     /**
 91:      * @return string|NULL
 92:      */
 93:     public function getComment()
 94:     {
 95:         return $this->comment;
 96:     }
 97: 
 98: 
 99:     /**
100:      * @param  string
101:      * @return static
102:      */
103:     public function addComment($val)
104:     {
105:         $this->comment .= $this->comment ? "\n$val" : $val;
106:         return $this;
107:     }
108: 
109: 
110:     /** @deprecated */
111:     public function setDocuments(array $s)
112:     {
113:         trigger_error(__METHOD__ . '() is deprecated, use similar setComment()', E_USER_DEPRECATED);
114:         return $this->setComment(implode("\n", $s));
115:     }
116: 
117: 
118:     /** @deprecated */
119:     public function getDocuments()
120:     {
121:         trigger_error(__METHOD__ . '() is deprecated, use similar getComment()', E_USER_DEPRECATED);
122:         return $this->comment ? [$this->comment] : [];
123:     }
124: 
125: 
126:     /** @deprecated */
127:     public function addDocument($s)
128:     {
129:         trigger_error(__METHOD__ . '() is deprecated, use addComment()', E_USER_DEPRECATED);
130:         return $this->addComment($s);
131:     }
132: 
133: }
134: 
Nette 2.4-20170221 API API documentation generated by ApiGen 2.8.0