-
Notifications
You must be signed in to change notification settings - Fork 1
/
SolSearchInterface.php
110 lines (92 loc) · 2.32 KB
/
SolSearchInterface.php
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
/**
* Interface for SolSearch, to be connected to a REST API
*/
interface SolSearchInterface {
const SCOPE_PRIVATE = 0;
const SCOPE_LOCAL = 1;
const SCOPE_NETWORK = 2;
const SCOPE_PUBLIC = 3;
/**
* List and search ads
*
* @param string $type
* Ad type. See data type docs. NULL or '0' means 'all'.
* @param array $params
* Associative array of the filters to apply to the search, namely
* - bool local: true to include only local results
* - floats circle: the lat, the lon and the km radius to search
* - string text: a string to search for in title, description & keywords
* - bool directexchange: TRUE to exclude transactionts that don't allow barter
* - bool indirectexchange: TRUE to exclude transactions that don't allow ccs
* - bool money: TRUE to exclude transactions that don't allow moneyi
*
* @todo HOW ARE THESE APPLIED IF MORE THAN ONE IS SPECIFIED?
*
* @param int $limit
* @param int $offset
* @param string $sort_by
*
* @return array
* A list of SolAd objects.
*/
public function searchAds($type, $params, $offset = 0, $limit = 10, $sort_by = 'expires,asc');
/**
* Get one ad by UUID
*
* @param string $uuid
*
* @return SolAd returns one SolAd object, or NULL
*/
public function getAd($uuid);
/**
* Update one ad.
*
* @param SolAd $ads
*
* @return bool
* TRUE if the update was successful
*/
public function updateAd(SolAd $ad);
/**
* Update many ads
*
* $param array $ads An array of SolAd objects
*
* @return bool
* TRUE if the update was successful
*/
public function bulkUpdateAds(array $ads);
/**
* Insert one ad.
*
* @param SolAd $ads
*
* @return bool
* TRUE if the insert was successful
*/
public function insertAd(SolAd $ad);
/**
* Delete an ad.
*
* @param string $uuid
*
* @return bool
* TRUE if the delete was successful
*/
public function deleteAd($uuid);
/**
* @param SolAd $ads
* Delete one or more ads.
*
* @param string[] $uuids
*
* @return bool
* TRUE if *ALL* deletes were successful, does NOT do partial delete if failure of any single deletion
*/
public function bulkDeleteAds(array $uuids);
/**
* Allow a group to remove itself
*/
public function bye();
}