-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathGetContentDetail.php
More file actions
47 lines (42 loc) · 1.16 KB
/
GetContentDetail.php
File metadata and controls
47 lines (42 loc) · 1.16 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
<?php
/**
* @Author Asim Sarwar
* Description Handle Smithsonian Institution Open Access get content details API end point
* ClassName GetContentDetail
*/
namespace App\CurrikiGo\Smithsonian\Contents;
use App\Exceptions\GeneralException;
use App\CurrikiGo\Smithsonian\Commands\Contents\GetContentDetailCommand;
class GetContentDetail
{
/**
* Smithsonian content detail instance
* @var \App\CurrikiGo\Smithsonian\Client
*/
private $smithsonianClient;
/**
* GetContentDetail constructor.
* Create a new smithsonianClient instance.
* @param object $client
* @return object
*/
public function __construct($client)
{
$this->smithsonianClient = $client;
}
/**
* Fetch Smithsonian content detail
* @param array $getParam
* @return json object $response
* @throws GeneralException
*/
public function fetch($getParam)
{
$response = $this->smithsonianClient->run(new GetContentDetailCommand($getParam));
if ( $response ) {
return $response;
} else {
throw new GeneralException('No Record Found!');
}
}
}