diff Lib/IMPL/Web/Application/ResourceContract.pm @ 227:70ad6bc20908

sync
author sergey
date Fri, 07 Sep 2012 16:32:17 +0400
parents b6cde007a175
children 431db7034a88
line wrap: on
line diff
--- a/Lib/IMPL/Web/Application/ResourceContract.pm	Wed Sep 05 15:10:26 2012 +0400
+++ b/Lib/IMPL/Web/Application/ResourceContract.pm	Fri Sep 07 16:32:17 2012 +0400
@@ -2,17 +2,32 @@
 use strict;
 use IMPL::lang qw(:declare);
 use IMPL::declare {
+	require => {
+		'ResourceClass' => 'IMPL::Web::Application::Resource'
+	},
 	base => [
 	   'IMPL::Object' => undef
 	]
 };
 
 BEGIN {
+	public property resourceFactory => PROP_ALL;
 	public property operations => PROP_ALL;
 	private property _namedResources => PROP_ALL;
 	private property _regexpResources => PROP_ALL; 
 }
 
+sub CTOR {
+	my $this = shift;
+	my %args = @_;
+	
+	$this->resourceFactory( $args{resourceFactory} || ResourceClass );
+}
+
+sub CreateResource {
+	my ($this,)
+}
+
 1;
 
 __END__
@@ -58,6 +73,14 @@
     ]
 )
 
+my $obj = My::App::Data->fetch('something');
+
+my $resource = $contract->CreateResource(
+    model => $obj,
+    parent => $prentResource,
+    id => 'item-something'
+);
+
 =end code 
 
 =head1 DESCRIPTION