forked from w3develops/w3Develops
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathossn.lib.objects.php
More file actions
79 lines (77 loc) · 1.87 KB
/
Copy pathossn.lib.objects.php
File metadata and controls
79 lines (77 loc) · 1.87 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
79
<?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 object
*
* @param int $guid Guid of object
*
* @return object
*/
function ossn_get_object($guid){
if(!empty($guid)){
$object = new OssnObject;
$search = $object->searchObject(array(
'wheres'=> "o.guid='{$guid}'",
'offset' => 1
));
if($search && isset($search[0]->guid)){
return $search[0];
}
}
return false;
}
/**
* Get entities of object
*
* @param object $object Must be valid object
* @param array $params Options
*
* @return object
*/
function ossn_get_object_entities($object, $params = array()){
if(isset($object->guid)){
$vars['owner_guid'] = $object->guid;
$vars['type'] = 'object';
$vars = array_merge($vars, $params);
return ossn_get_entities($vars);
}
return false;
}
/**
* Get objects
*
* @param array $params Options
* @param int $params['owner_guid'] object owner guid
* @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_objects(array $params){
$object = new OssnObject;
return $object->searchObject($params);
}
/**
* Get objects by type
*
* @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_objects_by_type(array $params){
return ossn_get_objects($params);
}