Skip to content

Commit 9546856

Browse files
committed
Added Conf/CodeTables.php and other updates
1 parent a5efbca commit 9546856

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

src/Conf/CodeTables.php

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?php
2+
3+
namespace Scriptotek\Alma\Conf;
4+
5+
use Scriptotek\Alma\Client;
6+
use Scriptotek\Alma\Model\PaginatedListGenerator;
7+
use Scriptotek\Alma\Model\SimplePaginatedList;
8+
use Scriptotek\Alma\Model\ReadOnlyArrayAccess;
9+
use Scriptotek\Alma\Conf\Library;
10+
11+
class CodeTables
12+
{
13+
use ReadOnlyArrayAccess;
14+
15+
/* @var Client */
16+
protected $client;
17+
18+
public function __construct(Client $client)
19+
{
20+
$this->client = $client;
21+
}
22+
23+
/**
24+
* Return an object containing the code table content.
25+
*
26+
* @return CodeTable object.
27+
*/
28+
public function getCodeTable($codetable)
29+
{
30+
return json_decode($this->client->get($this->urlBase()."/$codetable"));
31+
}
32+
33+
/**
34+
* Return a object containing a list of code tables.
35+
*
36+
* @return CodeTable ojbect list.
37+
*/
38+
public function getCodeTables()
39+
{
40+
return json_decode($this->client->get($this->urlBase()));
41+
}
42+
43+
/**
44+
* Generate the base URL for this resource.
45+
*
46+
* @return string
47+
*/
48+
protected function urlBase()
49+
{
50+
return '/conf/code-tables';
51+
}
52+
}
53+

0 commit comments

Comments
 (0)