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

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