NAME
Egg::Model::Session::Base::DBIC - Session management by DBIC.
SYNOPSIS
package MyApp::Model::Sesion;
__PACKAGE__->config(
dbic => {
label_schema => 'dbic_schma_label',
label_source => 'dbic_moniker_label',
id_field => 'id',
data_field => 'a_session',
time_field => 'lastmod',
},
);
__PACKAGE__->startup(
Base::DBIC
Store::Base64
ID::SHA1
Bind::Cookie
);
DESCRIPTION
The session data is preserved by using DBIC.
'Egg::Model::DBIC' should be able to be used for use.
And, 'Base::DBIC' is added to startup of the component module generated with Egg::Helper::Model::Session. Base::FileCache of default's It is not possible to cooperate and delete it, please.
Moreover, it is necessary to load Store system module to treat the session data appropriately.
__PACKAGE__->startup(
Base::DBIC
Store::Base64
ID::SHA1
Bind::Cookie
);
If AutoCommit is invalid and 'Egg::Plugin::DBIC' is effective in the setting of DBI, it is late commit.
CONFIGURATION
It sets in config of the session component module and it sets it to 'dbic' item with HASH.
__PACKAGE__->config(
dbic => {
.......
},
);
label_schema
It is Ra bell name because it obtains Schame of Egg::Model::DBIC.
The exception is generated in case of undefined.
label_source
Label name to obtain source object of session table from Egg::Model::DBIC.
The exception is generated in case of undefined.
id_field
Name of session ID column.
'id' is used in case of undefined.
data_field
Name of session data column.
'a_session' is used in case of undefined.
time_field
Name of updated day and hour column.
'lastmod' is used in case of undefined.
METHODS
Because most of these methods is the one that Egg::Model::Session internally uses it, it is not necessary to usually consider it on the application side.
moniker
The source object of the session table is returned from Egg::Model::DBIC.
_begin
If AutoCommit is effective, the transaction is begun. If it is invalid, nothing is done.
_commit
If AutoCommit is effective, the transaction is shut. If it is invalid, committing does the rollback if 'is_update' is effective.
If AutoCommit is invalid, nothing is done.
result
When the result of 'restore' is preserved, it is returned.
id_col
The content of 'id_filed' of the configuration is returned.
data_col
The content of 'data_filed' of the configuration is returned.
time_col
The content of 'time_field' of the configuration is returned.
restore ([SESSION_ID])
The session data obtained by received SESSION_ID is returned.
When SESSION_ID is not obtained, it acquires it in 'session_id' method.
insert ([SESSION_DATA], [SESSION_ID])
New session data is preserved.
SESSION_DATA is indispensable.
When SESSION_ID is not obtained, it acquires it in 'session_id' method.
update ([SESSION_DATA], [SESSION_ID])
Existing session data is updated.
SESSION_DATA is indispensable.
When SESSION_ID is not obtained, it acquires it in 'session_id' method.
close
After Egg::Model::Session::Manager::TieHash, commit is done.
However, if 'is_update' method is invalid, rollback is issued. In a word, if data was not substituted for the session, the data is annulled.
SEE ALSO
Egg::Release, Egg::Model::Session, Egg::Model::Session::Manager::Base, Egg::Model::Session::Manager::TieHash, Egg::Model, Egg::Model::DBIC, Time::Piece::MySQL,
AUTHOR
Masatoshi Mizuno <lushe@cpan.org>
COPYRIGHT AND LICENSE
Copyright (C) 2008 Bee Flag, Corp. <http://egg.bomcity.com/>, All Rights Reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.