diff Lib/IMPL/Web/View/TTLoader.pm @ 196:a705e848dcc7

added IMPL::Config::Reference
author cin
date Mon, 16 Apr 2012 17:42:54 +0400
parents 7a920771fd8e
children 891c04080658
line wrap: on
line diff
--- a/Lib/IMPL/Web/View/TTLoader.pm	Wed Apr 11 17:50:33 2012 +0400
+++ b/Lib/IMPL/Web/View/TTLoader.pm	Mon Apr 16 17:42:54 2012 +0400
@@ -11,6 +11,7 @@
 
 use parent qw(
     IMPL::Object
+    IMPL::Object::Serializable
 );
 
 BEGIN {
@@ -26,6 +27,26 @@
     private property _globals => PROP_ALL;
 }
 
+sub save {
+	my ($this,$context) = @_;
+	
+	$context->AddVar($_, $this->$_()) for qw(options provider context ext layoutBase);
+}
+
+sub restore {
+	my ($class,$data,$surrogate) = @_;
+	
+	my %params = @$data;
+	
+	my $refOpts = delete $params{options};
+	
+	if ($surrogate){
+		$surrogate->callCTOR($refOpts,%params);
+	} else {
+		$surrogate = $class->new($refOpts,%params);
+	}
+}
+
 sub CTOR {
     my ($this,$refOpts,%args) = @_;