working on new discussion system
This commit is contained in:
parent
cb55619457
commit
b84c79ab96
6 changed files with 357 additions and 3 deletions
43
lib/WebGUI/Forum.pm
Normal file
43
lib/WebGUI/Forum.pm
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
package WebGUI::Forum;
|
||||
|
||||
use WebGUI::Forum::Thread;
|
||||
use WebGUI::Session;
|
||||
use WebGUI::SQL;
|
||||
|
||||
sub create {
|
||||
my ($self, $data) = @_;
|
||||
$data->{forumId} = "new";
|
||||
my $forumId = WebGUI::SQL->setRow("forum","forumId",$data);
|
||||
return WebGUI::Forum->new($forumId);
|
||||
}
|
||||
|
||||
sub get {
|
||||
my ($self, $key) = @_;
|
||||
if ($key eq "") {
|
||||
return $self->{_properties};
|
||||
}
|
||||
return $self->{_properties}->{$key};
|
||||
}
|
||||
|
||||
sub getThread {
|
||||
my ($self, $threadId) = @_;
|
||||
unless (exists $self->{_thread}{$threadId}) {
|
||||
$self->{_thread}{$threadId} = WebGUI::Forum::Thread->new($threadId);
|
||||
}
|
||||
return $self->{_thread}{$threadId};
|
||||
}
|
||||
|
||||
sub new {
|
||||
my ($self, $forumId) = @_;
|
||||
my $properties = WebGUI::SQL->getRow("forum","forumId",$forumId);
|
||||
bless {_properties=>$properties}, $self;
|
||||
}
|
||||
|
||||
sub set {
|
||||
my ($self, $data) = @_;
|
||||
WebGUI::SQL->setRow("forum","forumId",$data);
|
||||
$self->{_properties} = $data;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue