Namespaces

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

Classes

  • Callback
  • Configurator
  • Environment
  • Framework
  • FreezableObject
  • Object

Interfaces

  • IFreezable

Exceptions

  • ArgumentOutOfRangeException
  • DeprecatedException
  • DirectoryNotFoundException
  • FileNotFoundException
  • InvalidArgumentException
  • InvalidStateException
  • IOException
  • MemberAccessException
  • NotImplementedException
  • NotSupportedException
  • OutOfRangeException
  • StaticClassException
  • UnexpectedValueException
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases
  • Nette homepage
 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;
 9: 
10: use Nette;
11: 
12: 
13: /**
14:  * @deprecated
15:  */
16: abstract class FreezableObject extends Object implements IFreezable
17: {
18:     /** @var bool */
19:     private $frozen = FALSE;
20: 
21: 
22:     /**
23:      * Makes the object unmodifiable.
24:      * @return void
25:      */
26:     public function freeze()
27:     {
28:         $this->frozen = TRUE;
29:     }
30: 
31: 
32:     /**
33:      * Is the object unmodifiable?
34:      * @return bool
35:      */
36:     public function isFrozen()
37:     {
38:         return $this->frozen;
39:     }
40: 
41: 
42:     /**
43:      * Creates a modifiable clone of the object.
44:      * @return void
45:      */
46:     public function __clone()
47:     {
48:         $this->frozen = FALSE;
49:     }
50: 
51: 
52:     /**
53:      * @return void
54:      */
55:     protected function updating()
56:     {
57:         if ($this->frozen) {
58:             $class = get_class($this);
59:             throw new InvalidStateException("Cannot modify a frozen object $class.");
60:         }
61:     }
62: 
63: }
64: 
Nette 2.2 API documentation generated by ApiGen 2.8.0