Code Duplication    Length = 13-13 lines in 2 locations

api/v1/class.DepartmentAPI.php 1 location

@@ 103-115 (lines=13) @@
100
        $dataTable = DataSetFactory::getDataTableByNames('fvs', 'shifts');
101
        $filter = new \Data\Filter("departmentID eq '$deptId'");
102
        $odata = $request->getAttribute('odata', new \ODataParams(array()));
103
        if($odata->filter !== false)
104
        {
105
            $clause = $odata->filter->getClause('departmentID');
106
            if($clause !== null)
107
            {
108
                return $response->withStatus(409);
109
            }
110
            else
111
            {
112
                $filter->appendChild('and');
113
                $filter->appendChild($odata->filter);
114
            }
115
        }
116
        $shifts = $dataTable->read($filter, $odata->select, $odata->top,
117
                                  $odata->skip, $odata->orderby);
118
        if($shifts === false)

api/v1/class.EventAPI.php 1 location

@@ 65-77 (lines=13) @@
62
        $dataTable = DataSetFactory::getDataTableByNames('fvs', 'shifts');
63
        $filter = new \Data\Filter("eventID eq '$eventId'");
64
        $odata = $request->getAttribute('odata', new \ODataParams(array()));
65
        if($odata->filter !== false)
66
        {
67
            $clause = $odata->filter->getClause('eventID');
68
            if($clause !== null)
69
            {
70
                return $response->withStatus(409);
71
            }
72
            else
73
            {
74
                $filter->appendChild('and');
75
                $filter->appendChild($odata->filter);
76
            }
77
        }
78
        $shifts = $dataTable->read($filter, $odata->select, $odata->top,
79
                                  $odata->skip, $odata->orderby);
80
        if($shifts === false)