system.php
2.41 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
class Flora_Api_Service_System extends Flora_Api_Service
{
const API_LANGUAGES_BYID = "system/language";
const API_LANGUAGES_LIST = "system/languages";
const API_PAGE_BYID = "system/page";
const API_SNIPPET_BYID = "system/snippet";
const API_PAGES_LIST = "system/pages";
const API_IP_INFO = "system/ipinfo";
const API_FEEDBACK = "system/feedback";
const API_INFLECT = "system/inflect";
const API_INFLECT_COUNT = "system/inflectcount";
const API_SITE_MAP = "system/sitemap";
/**
* @param $id
* @return Flora_Model_Language
*/
public function getLanguageById($id)
{
return $this->call(self::API_LANGUAGES_BYID, array("id" => $id));
}
/**
* @return Flora_Collection|Flora_Model_Language[]
*/
public function getLanguagesList()
{
return $this->call(self::API_LANGUAGES_LIST);
}
/**
* @param $id
* @return Flora_Model_Page
*/
public function getPageById($id)
{
return $this->call(self::API_PAGE_BYID, array("id" => $id));
}
/**
* @param $id
* @return Flora_Model_Snippet
*/
public function getSnippetById($id)
{
return $this->call(self::API_SNIPPET_BYID, array("id" => $id));
}
/**
* @param $category
* @return Flora_Model_Page[]|Flora_Collection
*/
public function getPagesList($category = '')
{
return $this->call(self::API_PAGES_LIST, array("category" => $category));
}
/**
* @param $email
* @param $text
* @return bool
*/
public function sendFeedback($email, $text)
{
return $this->call(self::API_FEEDBACK, array(), array('email' => $email, 'text' => $text));
}
/**
* @param $word
* @return Flora_Model_Inflect
*/
public function getInflect($word)
{
return $this->call(self::API_INFLECT, array('word' => $word), array());
}
/**
* @param $word
* @param $count
* @return Flora_Model_Inflect_Count
*/
public function getInflectCount($word, $count)
{
return $this->call(self::API_INFLECT_COUNT, array('word' => $word, 'count' => $count), array());
}
/**
* @param string $key
* @param string $data
* @return array
*/
public function getSiteMap($key = 'id', $data = 'bouquets')
{
return $this->call(self::API_SITE_MAP, ['key' => $key, 'data' => $data]);
}
}