mirror of
https://github.com/friendica/friendica
synced 2026-01-13 13:38:40 +01:00
New objects: Conversation and Item
This commit is contained in:
parent
4894619d7b
commit
6ef86e1fff
3 changed files with 471 additions and 3 deletions
57
object/Item.php
Normal file
57
object/Item.php
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
if(class_exists('Item'))
|
||||
return;
|
||||
|
||||
require_once('include/text.php');
|
||||
|
||||
/**
|
||||
* An item
|
||||
*/
|
||||
class Item {
|
||||
private $data = array();
|
||||
|
||||
public function __construct($data) {
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the item ID
|
||||
*
|
||||
* Returns:
|
||||
* _ the ID on success
|
||||
* _ false on failure
|
||||
*/
|
||||
public function get_id() {
|
||||
if(!x($this->data['id'])) {
|
||||
logger('[ERROR] Item::get_id : Item has no ID!!', LOGGER_DEBUG);
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->data['id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get data in a form usable by a conversation template
|
||||
*
|
||||
* Returns:
|
||||
* _ The data requested on success
|
||||
* _ false on failure
|
||||
*/
|
||||
public function get_template_data() {
|
||||
$result = array();
|
||||
|
||||
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get raw data
|
||||
*
|
||||
* We shouldn't need this
|
||||
*/
|
||||
public function get_data() {
|
||||
return $this->data;
|
||||
}
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue