]> git.mxchange.org Git - friendica.git/blob - object/Item.php
New objects: Conversation and Item
[friendica.git] / object / Item.php
1 <?php
2 if(class_exists('Item'))
3         return;
4
5 require_once('include/text.php');
6
7 /**
8  * An item
9  */
10 class Item {
11         private $data = array();
12
13         public function __construct($data) {
14                 $this->data = $data;
15         }
16
17         /**
18          * Get the item ID
19          *
20          * Returns:
21          *              _ the ID on success
22          *              _ false on failure
23          */
24         public function get_id() {
25                 if(!x($this->data['id'])) {
26                         logger('[ERROR] Item::get_id : Item has no ID!!', LOGGER_DEBUG);
27                         return false;
28                 }
29
30                 return $this->data['id'];
31         }
32
33         /**
34          * Get data in a form usable by a conversation template
35          *
36          * Returns:
37          *              _ The data requested on success
38          *              _ false on failure
39          */
40         public function get_template_data() {
41                 $result = array();
42
43                 
44
45                 return $result;
46         }
47
48         /**
49          * Get raw data
50          *
51          * We shouldn't need this
52          */
53         public function get_data() {
54                 return $this->data;
55         }
56 }
57 ?>