| 1 | package Daje::Workflow::Database::Model::History; | ||
| 2 | use Mojo::Base -base, -signatures; | ||
| 3 | |||
| 4 | |||
| 5 | # NAME | ||
| 6 | # ==== | ||
| 7 | # | ||
| 8 | # Daje::Workflow::Database::Model::History | ||
| 9 | # | ||
| 10 | # | ||
| 11 | # REQUIRES | ||
| 12 | # ======== | ||
| 13 | # | ||
| 14 | # Mojo::Base> | ||
| 15 | # | ||
| 16 | # METHODS | ||
| 17 | # ======= | ||
| 18 | # | ||
| 19 | # insert($self, $data); | ||
| 20 | # | ||
| 21 | # load_list($self, $workflow_pkey); | ||
| 22 | # | ||
| 23 | # | ||
| 24 | # LICENSE | ||
| 25 | # ======= | ||
| 26 | # | ||
| 27 | # Copyright (C) janeskil1525. | ||
| 28 | # | ||
| 29 | # This library is free software; you can redistribute it and/or modify | ||
| 30 | # it under the same terms as Perl itself. | ||
| 31 | # | ||
| 32 | # AUTHOR | ||
| 33 | # ====== | ||
| 34 | # | ||
| 35 | # janeskil1525 E<lt>janeskil1525@gmail.comE<gt> | ||
| 36 | # | ||
| 37 | |||
| 38 | |||
| 39 | has 'db'; | ||
| 40 | |||
| 41 | sub load_list($self, $workflow_pkey) { | ||
| 42 | my $data = $self->db->select( | ||
| 43 | 'workflow', ['*'], | ||
| 44 | { | ||
| 45 | workflow_fkey => $workflow_pkey | ||
| 46 | } | ||
| 47 | ); | ||
| 48 | my $hashes; | ||
| 49 | |||
| 50 | $hashes = $data->hashes if $data->rows > 0; | ||
| 51 | |||
| 52 | return $hashes; | ||
| 53 | } | ||
| 54 | |||
| 55 | sub insert($self, $data) { | ||
| 56 | $self->db->insert( | ||
| 57 | 'history', | ||
| 58 | { | ||
| 59 | %$data | ||
| 60 | } | ||
| 61 | ); | ||
| 62 | } | ||
| 63 | |||
| 64 | 1; | ||
| 65 | |||
| 66 | |||
| 67 | |||
| 68 | |||
| 69 | |||
| 70 | |||
| 71 | |||
| 72 | |||
| 73 | |||
| 74 | |||
| 75 | |||
| 76 | |||
| 77 | |||
| 78 | |||
| 79 | |||
| 80 | |||
| 81 | |||
| 82 | |||
| 83 | |||
| 84 | |||
| 85 | |||
| 86 | #################### pod generated by Pod::Autopod - keep this line to make pod updates possible #################### | ||
| 87 | |||
| 88 | =head1 NAME | ||
| 89 | |||
| 90 | |||
| 91 | Daje::Workflow::Database::Model::History | ||
| 92 | |||
| 93 | |||
| 94 | |||
| 95 | |||
| 96 | =head1 REQUIRES | ||
| 97 | |||
| 98 | |||
| 99 | Mojo::Base> | ||
| 100 | |||
| 101 | |||
| 102 | |||
| 103 | =head1 METHODS | ||
| 104 | |||
| 105 | |||
| 106 | insert($self, $data); | ||
| 107 | |||
| 108 | load_list($self, $workflow_pkey); | ||
| 109 | |||
| 110 | |||
| 111 | |||
| 112 | |||
| 113 | =head1 AUTHOR | ||
| 114 | |||
| 115 | |||
| 116 | janeskil1525 E<lt>janeskil1525@gmail.comE<gt> | ||
| 117 | |||
| 118 | |||
| 119 | |||
| 120 | =head1 LICENSE | ||
| 121 | |||
| 122 | |||
| 123 | Copyright (C) janeskil1525. | ||
| 124 | |||
| 125 | This library is free software; you can redistribute it and/or modify | ||
| 126 | it under the same terms as Perl itself. | ||
| 127 | |||
| 128 | |||
| 129 | |||
| 130 | =cut | ||
| 131 |