| 1 | # | ||||||||||
| 2 | # This file is part of CatalystX-ExtJS | ||||||||||
| 3 | # | ||||||||||
| 4 | # This software is Copyright (c) 2011 by Moritz Onken. | ||||||||||
| 5 | # | ||||||||||
| 6 | # This is free software, licensed under: | ||||||||||
| 7 | # | ||||||||||
| 8 | # The (three-clause) BSD License | ||||||||||
| 9 | # | ||||||||||
| 10 | package MyApp::Controller::User::DBIC; | ||||||||||
| 11 | |||||||||||
| 12 | 1 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | 1 | extends 'Catalyst::Controller::DBIC::API::RPC'; | |||||||||
| 14 | 1 | with 'CatalystX::Controller::ExtJS::Direct'; | |||||||||
| 15 | |||||||||||
| 16 | |||||||||||
| 17 | 1 | __PACKAGE__->config( | |||||||||
| 18 | actions => { | ||||||||||
| 19 | setup => { PathPart => 'user', Chained => '/' }, | ||||||||||
| 20 | create => { Direct => undef, DirectArgs => 1 }, | ||||||||||
| 21 | item => { Direct => undef }, | ||||||||||
| 22 | update => { Direct => undef, DirectArgs => 1 }, | ||||||||||
| 23 | delete => { Direct => undef }, | ||||||||||
| 24 | list => { Direct => undef, DirectArgs => 1 }, | ||||||||||
| 25 | }, | ||||||||||
| 26 | class => 'DBIC::User', | ||||||||||
| 27 | use_json_boolean => 1, | ||||||||||
| 28 | create_requires => [qw(email first last)], | ||||||||||
| 29 | return_object => 1, | ||||||||||
| 30 | ); | ||||||||||
| 31 | |||||||||||
| 32 | 0 | ▶ | before 'deserialize' => sub { | ||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=24.8
| |||||||||||
| 33 | 0 | my ($self, $c) = @_; | |||||||||
| 34 | 0 | ▶ | $c->req->data($c->req->data->[0]) if(ref $c->req->data eq 'ARRAY'); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 35 | 0 | ▶ | $c->req->data(undef) unless(ref $c->req->data); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 36 | 1 | }; | |||||||||
| 37 | |||||||||||
| 38 | |||||||||||
| 39 | 1 | 1; | |||||||||