Skip to content

Commit 0530aed

Browse files
committed
Add shortcut to jobs + some property declarations
1 parent 6792b0c commit 0530aed

File tree

1 file changed

+29
-6
lines changed

1 file changed

+29
-6
lines changed

src/Client.php

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
use Scriptotek\Alma\Bibs\Bibs;
2222
use Scriptotek\Alma\Bibs\Items;
2323
use Scriptotek\Alma\Conf\Conf;
24+
use Scriptotek\Alma\Conf\Jobs;
25+
use Scriptotek\Alma\Conf\Libraries;
2426
use Scriptotek\Alma\Conf\Library;
2527
use Scriptotek\Alma\Exception\ClientException as AlmaClientException;
2628
use Scriptotek\Alma\Exception\InvalidApiKey;
@@ -86,15 +88,35 @@ class Client
8688
/** @var float Number of seconds to sleep before retrying after a server error */
8789
public $sleepTimeOnServerError = 10;
8890

91+
/**
92+
* @var Conf
93+
*/
94+
public $conf;
95+
96+
/**
97+
* @var Libraries
98+
*/
99+
public $libraries;
100+
101+
/**
102+
* @var Jobs
103+
*/
104+
public $jobs;
105+
106+
/**
107+
* @var TaskLists
108+
*/
109+
public $taskLists;
110+
89111
/**
90112
* Create a new client to connect to a given Alma instance.
91113
*
92-
* @param string $key API key
93-
* @param string $region Hosted region code, used to build base URL
94-
* @param string $zone Alma zone (Either Zones::INSTITUTION or Zones::NETWORK)
95-
* @param HttpClientInterface $http
96-
* @param RequestFactoryInterface $requestFactory
97-
* @param UriFactoryInterface $uriFactory
114+
* @param ?string $key API key
115+
* @param string $region Hosted region code, used to build base URL
116+
* @param string $zone Alma zone (Either Zones::INSTITUTION or Zones::NETWORK)
117+
* @param ?HttpClientInterface $http
118+
* @param ?RequestFactoryInterface $requestFactory
119+
* @param ?UriFactoryInterface $uriFactory
98120
*
99121
* @throws \ErrorException
100122
*/
@@ -129,6 +151,7 @@ public function __construct(
129151

130152
$this->conf = new Conf($this);
131153
$this->libraries = $this->conf->libraries; // shortcut
154+
$this->jobs = $this->conf->jobs; // shortcut
132155

133156
$this->taskLists = new TaskLists($this);
134157

0 commit comments

Comments
 (0)