Namespaces

  • Nette
    • Application
      • Diagnostics
      • Responses
      • Routers
      • UI
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Diagnostics
      • Drivers
      • Reflection
      • Table
    • DI
      • Config
        • Adapters
      • Diagnostics
      • Extensions
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
      • Diagnostics
    • Iterators
    • Latte
      • Macros
    • Loaders
    • Localization
    • Mail
    • PhpGenerator
    • Reflection
    • Security
      • Diagnostics
    • Templating
    • Utils
  • NetteModule
  • none

Classes

  • ArrayHash
  • ArrayList
  • Callback
  • Configurator
  • DateTime
  • Environment
  • Framework
  • FreezableObject
  • Image
  • Object
  • ObjectMixin

Interfaces

  • IFreezable

Exceptions

  • ArgumentOutOfRangeException
  • DeprecatedException
  • DirectoryNotFoundException
  • FatalErrorException
  • FileNotFoundException
  • InvalidArgumentException
  • InvalidStateException
  • IOException
  • MemberAccessException
  • NotImplementedException
  • NotSupportedException
  • OutOfRangeException
  • StaticClassException
  • UnexpectedValueException
  • UnknownImageFileException
  • 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:  * Defines an object that has a modifiable and a read-only (frozen) state.
15:  *
16:  * @author     David Grudl
17:  *
18:  * @property-read bool $frozen
19:  * @deprecated
20:  */
21: abstract class FreezableObject extends Object implements IFreezable
22: {
23:     /** @var bool */
24:     private $frozen = FALSE;
25: 
26: 
27:     /**
28:      * Makes the object unmodifiable.
29:      * @return void
30:      */
31:     public function freeze()
32:     {
33:         $this->frozen = TRUE;
34:     }
35: 
36: 
37:     /**
38:      * Is the object unmodifiable?
39:      * @return bool
40:      */
41:     public function isFrozen()
42:     {
43:         return $this->frozen;
44:     }
45: 
46: 
47:     /**
48:      * Creates a modifiable clone of the object.
49:      * @return void
50:      */
51:     public function __clone()
52:     {
53:         $this->frozen = FALSE;
54:     }
55: 
56: 
57:     /**
58:      * @return void
59:      */
60:     protected function updating()
61:     {
62:         if ($this->frozen) {
63:             $class = get_class($this);
64:             throw new InvalidStateException("Cannot modify a frozen object $class.");
65:         }
66:     }
67: 
68: }
69: 
Nette 2.1 API documentation generated by ApiGen 2.8.0