root/devel/mod/rpc/lib/class_comment.php

Revision 269, 1.5 kB (checked in by ben, 3 years ago)

--

  • Property svn:eol-style set to native
Line 
1 <?php
2
3     Class Comment extends ElggObject
4     {
5         var $post_id;
6         var $owner;
7         var $postedname;
8         var $body;
9         var $posted;
10         var $type = 'comment';
11
12         var $exists;
13
14         function Comment($var = 'default')
15         {
16             $this->exists = false;
17
18             if ($var != "")
19             {
20
21                 if ($comment = get_record('weblog_comments','ident',$var)) {
22                     $this->ident      = $comment->ident;
23                     $this->post_id    = $comment->post_id;
24                     $this->owner      = $comment->owner;
25                     $this->postedname = $comment->postedname;
26                     $this->body       = $comment->body;
27                     $this->posted     = $comment->posted;
28                     $this->exists = true;
29                 } else {
30                     $this->exists = false;
31                 }
32             }
33             else
34             {
35                 $this->exists = false;
36             }
37         }
38
39         function getPostId()
40         {
41             return $this->post_id;
42         }
43
44         function getOwner()
45         {
46             return $this->owner;
47         }
48
49         function getPostedName()
50         {
51             return $this->postedname;
52         }
53
54         function getBody()
55         {
56             return $this->body;
57         }
58
59         function getPosted()
60         {
61             return $this->posted;
62         }
63
64         function delete()
65         {
66             return delete_records('weblog_comments','ident',$this->ident);
67         }
68     }
69
70 ?>
71
Note: See TracBrowser for help on using the browser.