Code Duplication    Length = 11-12 lines in 3 locations

src/Database/ActiveRecordModel.php 3 locations

@@ 128-138 (lines=11) @@
125
     *
126
     * @return this
127
     */
128
    public function findWhere($where, $value)
129
    {
130
        $this->checkDb();
131
        $params = is_array($value) ? $value : [$value];
132
        return $this->db->connect()
133
                        ->select()
134
                        ->from($this->tableName)
135
                        ->where($where)
136
                        ->execute($params)
137
                        ->fetchInto($this);
138
    }
139
140
141
@@ 173-183 (lines=11) @@
170
     *
171
     * @return array of object of this class
172
     */
173
    public function findAllWhere($where, $value)
174
    {
175
        $this->checkDb();
176
        $params = is_array($value) ? $value : [$value];
177
        return $this->db->connect()
178
                        ->select()
179
                        ->from($this->tableName)
180
                        ->where($where)
181
                        ->execute($params)
182
                        ->fetchAllClass(get_class($this));
183
    }
184
185
186
@@ 320-331 (lines=12) @@
317
     *
318
     * @return void
319
     */
320
    public function deleteWhere($where, $value)
321
    {
322
        $this->checkDb();
323
        $params = is_array($value) ? $value : [$value];
324
325
        $this->db->connect()
326
                 ->deleteFrom($this->tableName)
327
                 ->where($where)
328
                 ->execute($params);
329
330
        $this->id = null;
331
    }
332
}
333