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
      • Traits
    • Reflection
    • Security
    • Tokenizer
    • Utils
  • Tracy
    • Bridges
      • Nette
  • none

Traits

  • CommentAware
  • FunctionLike
  • NameAware
  • VisibilityAware
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases
 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\Traits;
 9: 
10: use Nette;
11: 
12: 
13: /**
14:  * @internal
15:  */
16: trait VisibilityAware
17: {
18:     /** @var string|null  public|protected|private */
19:     private $visibility;
20: 
21: 
22:     /**
23:      * @param  string|null  public|protected|private
24:      * @return static
25:      */
26:     public function setVisibility($val)
27:     {
28:         if (!in_array($val, ['public', 'protected', 'private', null], true)) {
29:             throw new Nette\InvalidArgumentException('Argument must be public|protected|private.');
30:         }
31:         $this->visibility = $val;
32:         return $this;
33:     }
34: 
35: 
36:     /**
37:      * @return string|null
38:      */
39:     public function getVisibility()
40:     {
41:         return $this->visibility;
42:     }
43: }
44: 
Nette 2.4-20180918 API API documentation generated by ApiGen 2.8.0