Skip to content

Commit a5efbca

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

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

src/Conf/Conf.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Scriptotek\Alma\Client;
66
use Scriptotek\Alma\Conf\Jobs;
7+
use Scriptotek\Alma\Conf\CodeTables;
78

89
class Conf
910
{
@@ -12,5 +13,6 @@ public function __construct(Client $client)
1213
$this->client = $client;
1314
$this->libraries = new Libraries($client);
1415
$this->jobs = new Jobs($client);
16+
$this->codetables = new CodeTables($client);
1517
}
1618
}

src/Users/UserStatistics.php

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,49 @@ public function getStatistics()
2424
return $stats;
2525
}
2626

27+
/**
28+
* Get a statistic.
29+
*
30+
* @return Statistic.
31+
*/
32+
public function getStatistic($typeCode,$categoryCode)
33+
{
34+
$stats = array();
35+
foreach ($this->data as $statistic) {
36+
if (($statistic->category_type->value == $typeCode) &&
37+
($statistic->statistic_category->value == $categoryCode)) {
38+
array_push($stats,$statistic);
39+
}
40+
}
41+
return $stats;
42+
}
43+
44+
/**
45+
* Add a user statistic.
46+
*
47+
*/
48+
public function addStatistic($typeCode,$categoryCode)
49+
{
50+
}
51+
52+
/**
53+
* Delete a user statistic.
54+
*
55+
*/
56+
public function removeStatistic($typeCode,$categoryCode)
57+
{
58+
}
59+
60+
/**
61+
* Update a user statistic.
62+
*
63+
*/
64+
public function updateStatistic($fromTypeCode,$fromCategoryCode,$toTypeCode,$toCategoryCode)
65+
{
66+
$this->removeStatistic($fromTypeCode,$categoryCode);
67+
$this->addStatistic($toTypeCode,$toCategoryCode);
68+
}
69+
2770
/**
2871
* Get Stats By Type Code.
2972
*

0 commit comments

Comments
 (0)