Completed
Push — master ( aa79f5...006947 )
by Raphaël
03:14
created

RegistrationCertain::getRegistrationsByEventCode()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 6

Duplication

Lines 9
Ratio 100 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 9
loc 9
rs 9.6666
cc 2
eloc 6
nc 2
nop 1
1
<?php
2
namespace Wabel\CertainAPI\Ressources;
3
4
use Wabel\CertainAPI\Interfaces\CertainRessourceInterface;
5
use Wabel\CertainAPI\CertainRessourceAbstract;
6
7
/**
8
 * RegistrationCertain about the Registration entity
9
 *
10
 * @author rbergina
11
 */
12
class RegistrationCertain extends CertainRessourceAbstract implements CertainRessourceInterface
13
{
14
    public function getRessourceName(){
15
        return 'Registration';
16
    }
17
    public function getMandatoryFields()
18
    {
19
        return array('profile');
20
    }
21
22
    /**
23
     * Return with all the result from certain.
24
     * @return RegistrationCertain[]
25
     */
26 View Code Duplication
    public function getRegistrations()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
27
    {
28
        $request=  $this->get();
29
        if($request->isSuccessFul()){
30
            $registrationCertainResults = $request->getResults();
31
            return $registrationCertainResults->registrations;
32
        }
33
        return null;
34
    }
35
    
36
    /**
37
     * Return with all the result from certain.
38
     * @return RegistrationCertain[]
39
     */
40 View Code Duplication
    public function getRegistrationsByEventCode($eventCode)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
41
    {
42
        $request=  $this->get($eventCode);
43
        if($request->isSuccessFul()){
44
            $registrationCertainResults = $request->getResults();
45
            return $registrationCertainResults->registrations;
46
        }
47
        return null;
48
    }
49
    
50
    
51
}