system.php
1.43 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
<?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";
/**
* @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));
}
/**
* @return stdClass
*/
public function getIPInfo()
{
return $this->call(self::API_IP_INFO);
}
}