|
Lines 121-127
sub store {
Link Here
|
| 121 |
my ($self) = @_; |
121 |
my ($self) = @_; |
| 122 |
|
122 |
|
| 123 |
try { |
123 |
try { |
| 124 |
return $self->_result()->update_or_insert() ? $self : undef; |
124 |
my $object = $self->_result()->update_or_insert() ? $self : undef; |
|
|
125 |
$object->discard_changes if $object->_has_derived_columns && defined wantarray; |
| 126 |
return $object; |
| 125 |
} |
127 |
} |
| 126 |
catch { |
128 |
catch { |
| 127 |
# Catch problems and raise relevant exceptions |
129 |
# Catch problems and raise relevant exceptions |
|
Lines 401-406
sub AUTOLOAD {
Link Here
|
| 401 |
return $r; |
403 |
return $r; |
| 402 |
} |
404 |
} |
| 403 |
|
405 |
|
|
|
406 |
=head3 _has_derived_columns |
| 407 |
|
| 408 |
This method is a flag that tells us if an object has derived columns generated by the database. |
| 409 |
If the object does, this method should return true. If not, it can be left out. |
| 410 |
|
| 411 |
=cut |
| 412 |
|
| 413 |
sub _has_derived_columns { |
| 414 |
return 0; |
| 415 |
} |
| 416 |
|
| 404 |
=head3 _type |
417 |
=head3 _type |
| 405 |
|
418 |
|
| 406 |
This method must be defined in the child class. The value is the name of the DBIC resultset. |
419 |
This method must be defined in the child class. The value is the name of the DBIC resultset. |
| 407 |
- |
|
|