forked from w3develops/w3Develops
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathossn.lib.annotations.php
More file actions
78 lines (76 loc) · 1.97 KB
/
ossn.lib.annotations.php
File metadata and controls
78 lines (76 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
/**
* Open Source Social Network
*
* @package (softlab24.com).ossn
* @author OSSN Core Team <info@softlab24.com>
* @copyright (C) SOFTLAB24 LIMITED
* @license Open Source Social Network License (OSSN LICENSE) http://www.opensource-socialnetwork.org/licence
* @link https://www.opensource-socialnetwork.org/
*/
/**
* Ossn get annotation
*
* @param int $guid Guid of annotation
*
* @return object
*/
function ossn_get_annotation($id){
if(!empty($id)){
$annotation = new OssnAnnotation;
$annotation->annotation_id = $id;
$annotation = $annotation->getAnnotationById();
if($annotation){
return $annotation;
}
}
return false;
}
/**
* Get entities of annotation
*
* @param object $annotation Must be valid annotation object
* @param array $params Options
*
* @return object
*/
function ossn_get_annotation_entities($annotation, $params = array()){
if(isset($annotation->id)){
$vars['owner_guid'] = $annotation->id;
$vars['type'] = 'annotation';
$vars = array_merge($vars, $params);
return ossn_get_entities($vars);
}
return false;
}
/**
* Get Annotations
*
* @param array $params Options
* @param int $params['owner_guid'] annotation owner guid
* @param string $params['type'] annotation type
* @param string $params['subtype'] annotation subtype
* @param string $params['limit'] limit of fetch data
* @param string $params['order_by'] order fetch data
*
* @return object
*/
function ossn_get_annotations(array $params){
$annotation = new OssnAnnotation;
return $annotation->searchAnnotation($params);
}
/**
* Get annotations by types
*
* @param array $params Options
* @param string $params['type'] object type
* @param string $params['subtype'] object subtype
* @param string $params['limit'] limit of fetch data
* @param string $params['order_by'] order fetch data
*
* @return object
*/
function ossn_get_annotations_by_type(array $params){
$annotation = new OssnAnnotation;
return $annotation->searchAnnotation($params);
}