-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathGetContentList.php
47 lines (42 loc) · 1.14 KB
/
GetContentList.php
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
<?php
/**
* @Author Asim Sarwar
* Description Handle Smithsonian Institution Open Access Get Content List API end point
* ClassName GetContentList
*/
namespace App\CurrikiGo\Smithsonian\Contents;
use App\Exceptions\GeneralException;
use App\CurrikiGo\Smithsonian\Commands\Contents\GetContentListCommand;
class GetContentList
{
/**
* Smithsonian content list instance
* @var \App\CurrikiGo\Smithsonian\Client
*/
private $smithsonianClient;
/**
* GetContentList constructor.
* Create a new smithsonianClient instance.
* @param object $client
* @return object
*/
public function __construct($client)
{
$this->smithsonianClient = $client;
}
/**
* Fetch Smithsonian contents list
* @param array $getParam
* @return json object $response
* @throws GeneralException
*/
public function fetch($getParam)
{
$response = $this->smithsonianClient->run(new GetContentListCommand($getParam));
if ( $response ) {
return $response;
} else {
throw new GeneralException('No Record Found!');
}
}
}