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

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