Code Duplication    Length = 18-18 lines in 2 locations

src/Database/Bindings/LogsBinding.php 1 location

@@ 119-136 (lines=18) @@
116
     *
117
     * @return Log[]
118
     */
119
    public function listByDevice($id, $params = [])
120
    {
121
        $statement = $this->database()->prepare("
122
            SELECT *
123
                FROM `" . $this->databaseTable() . "`
124
                WHERE
125
                  `" . Device::ID . "` = :id
126
                ORDER BY
127
                    " . $this->listOrder() . "
128
        ");
129
        $list = [];
130
        if ($statement->execute(['id' => $id])) {
131
            while ($row = $statement->fetch()) {
132
                $list[] = $this->instantiateListedObject($row, $params);
133
            }
134
        }
135
        return $list;
136
    }
137
}
138

src/Database/Bindings/UrlsBinding.php 1 location

@@ 54-71 (lines=18) @@
51
     * @param array $params (Optional) Associative array of additional request parameters
52
     * @return Url[]
53
     */
54
    public function listByDevice($id, $params = [])
55
    {
56
        $statement = $this->database()->prepare("
57
            SELECT *
58
                FROM `" . $this->databaseTable() . "`
59
                WHERE
60
                  `" . Device::ID . "` = :id
61
                ORDER BY
62
                    " . $this->listOrder() . "
63
        ");
64
        $list = [];
65
        if ($statement->execute(['id' => $id])) {
66
            while ($row = $statement->fetch()) {
67
                $list[] = $this->instantiateListedObject($row, $params);
68
            }
69
        }
70
        return $list;
71
    }
72
73
    protected function listOrder()
74
    {