Completed
Pull Request — master (#321)
by
unknown
04:23
created

OfferEditingServiceDecoratorTrait   A

Complexity

Total Complexity 15

Size/Duplication

Total Lines 97
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 15
lcom 1
cbo 1
dl 0
loc 97
rs 10
c 0
b 0
f 0

16 Methods

Rating   Name   Duplication   Size   Complexity  
getDecoratedEditingService() 0 1 ?
A addLabel() 0 5 1
A removeLabel() 0 5 1
A addImage() 0 5 1
A updateImage() 0 5 1
A removeImage() 0 5 1
A selectMainImage() 0 5 1
A updateDescription() 0 5 1
A updateTypicalAgeRange() 0 5 1
A deleteTypicalAgeRange() 0 5 1
A updateOrganizer() 0 5 1
A deleteOrganizer() 0 5 1
A updateContactPoint() 0 5 1
A updateBookingInfo() 0 5 1
A updatePriceInfo() 0 5 1
A updateTitle() 0 5 1
1
<?php
2
3
namespace CultuurNet\UDB3\Offer;
4
5
use CultuurNet\UDB3\BookingInfo;
6
use CultuurNet\UDB3\ContactPoint;
7
use CultuurNet\UDB3\Description;
8
use CultuurNet\UDB3\Label;
9
use CultuurNet\UDB3\Language;
10
use CultuurNet\UDB3\Media\Image;
11
use CultuurNet\UDB3\PriceInfo\PriceInfo;
12
use ValueObjects\StringLiteral\StringLiteral;
13
14
trait OfferEditingServiceDecoratorTrait
15
{
16
    /**
17
     * @return OfferEditingServiceInterface
18
     */
19
    abstract protected function getDecoratedEditingService();
20
21
    public function addLabel($id, Label $label)
22
    {
23
        return $this->getDecoratedEditingService()
24
            ->addLabel($id, $label);
25
    }
26
27
    public function removeLabel($id, Label $label)
28
    {
29
        return $this->getDecoratedEditingService()
30
            ->removeLabel($id, $label);
31
    }
32
33
    public function updateTitle($id, Language $language, StringLiteral $title)
34
    {
35
        return $this->getDecoratedEditingService()
36
            ->updateTitle($id, $language, $title);
37
    }
38
39
    public function addImage($id, Image $image)
40
    {
41
        return $this->getDecoratedEditingService()
42
            ->addImage($id, $image);
43
    }
44
45
    public function updateImage($id, Image $image, StringLiteral $description, StringLiteral $copyrightHolder)
46
    {
47
        return $this->getDecoratedEditingService()
48
            ->updateImage($id, $image, $description, $copyrightHolder);
49
    }
50
51
    public function removeImage($id, Image $image)
52
    {
53
        return $this->getDecoratedEditingService()
54
            ->removeImage($id, $image);
55
    }
56
57
    public function selectMainImage($id, Image $image)
58
    {
59
        return $this->getDecoratedEditingService()
60
            ->selectMainImage($id, $image);
61
    }
62
63
    public function updateDescription($id, Language $language, Description $description)
64
    {
65
        return $this->getDecoratedEditingService()
66
            ->updateDescription($id, $language, $description);
67
    }
68
69
    public function updateTypicalAgeRange($id, $ageRange)
70
    {
71
        return $this->getDecoratedEditingService()
72
            ->updateTypicalAgeRange($id, $ageRange);
73
    }
74
75
    public function deleteTypicalAgeRange($id)
76
    {
77
        return $this->getDecoratedEditingService()
78
            ->deleteTypicalAgeRange($id);
79
    }
80
81
    public function updateOrganizer($id, $organizerId)
82
    {
83
        return $this->getDecoratedEditingService()
84
            ->updateOrganizer($id, $organizerId);
85
    }
86
87
    public function deleteOrganizer($id, $organizerId)
88
    {
89
        return $this->getDecoratedEditingService()
90
            ->deleteOrganizer($id, $organizerId);
91
    }
92
93
    public function updateContactPoint($id, ContactPoint $contactPoint)
94
    {
95
        return $this->getDecoratedEditingService()
96
            ->updateContactPoint($id, $contactPoint);
97
    }
98
99
    public function updateBookingInfo($id, BookingInfo $bookingInfo)
100
    {
101
        return $this->getDecoratedEditingService()
102
            ->updateBookingInfo($id, $bookingInfo);
103
    }
104
105
    public function updatePriceInfo($id, PriceInfo $priceInfo)
106
    {
107
        return $this->getDecoratedEditingService()
108
            ->updatePriceInfo($id, $priceInfo);
109
    }
110
}
111