Collection   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 45
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A urlBase() 0 4 1
A isInitialized() 0 4 1
1
<?php
2
3
namespace Scriptotek\Alma\Electronic;
4
5
use Scriptotek\Alma\Client;
6
use Scriptotek\Alma\Model\LazyResource;
7
8
/**
9
 * A single Collection resource.
10
 */
11
class Collection extends LazyResource
12
{
13
    /* @var string */
14
    public $collection_id;
15
16
    /* @var Services */
17
    public $services;
18
19
    public function __construct(Client $client, $collection_id)
20
    {
21
        parent::__construct($client);
22
        $this->collection_id = $collection_id;
23
        // FUTURE: $this->services = Services::make($this->client, $this);
24
    }
25
26
    /**
27
     * Generate the base URL for this resource.
28
     *
29
     * @return string
30
     */
31
    protected function urlBase()
32
    {
33
        return "/electronic/e-collections/{$this->collection_id}";
34
    }
35
36
    /**
37
     * Get the services for this collection.
38
     */
39
//    public function getServices()
40
//    {
41
//        return $this->services;
42
//    }
43
44
    /**
45
     * Check if we have the full representation of our data object.
46
     *
47
     * @param \stdClass $data
48
     *
49
     * @return bool
50
     */
51
    protected function isInitialized($data)
52
    {
53
        return isset($data->public_name);
54
    }
55
}
56