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 property description.
15: */
16: class Property extends Member
17: {
18: /** @var mixed */
19: public $value;
20:
21: /** @var bool */
22: private $static = FALSE;
23:
24:
25: /**
26: * @deprecated
27: * @return static
28: */
29: public static function from(\ReflectionProperty $from)
30: {
31: return (new Factory)->fromPropertyReflection($from);
32: }
33:
34:
35: /**
36: * @return static
37: */
38: public function setValue($val)
39: {
40: $this->value = $val;
41: return $this;
42: }
43:
44:
45: /**
46: * @return mixed
47: */
48: public function getValue()
49: {
50: return $this->value;
51: }
52:
53:
54: /**
55: * @param bool
56: * @return static
57: */
58: public function setStatic($state = TRUE)
59: {
60: $this->static = (bool) $state;
61: return $this;
62: }
63:
64:
65: /**
66: * @return bool
67: */
68: public function isStatic()
69: {
70: return $this->static;
71: }
72:
73: }
74: