Code Duplication    Length = 9-9 lines in 2 locations

src/Database.php 2 locations

@@ 239-247 (lines=9) @@
236
     * @param string $fieldValue Field value
237
     * @return object[] Found object instance or an empty stdClass instance
238
     */
239
    public function fetchCollectionByField($className, $fieldName, $fieldValue)
240
    {
241
        // Build SQL statement
242
        $sql = 'SELECT *
243
        FROM `'.$className::$_table_name.'`
244
        WHERE `'.$fieldName.'` = '.$this->driver->quote($fieldValue);
245
246
        return $this->fetch($sql);
247
    }
248
249
    /**
250
     * Get one record from database by its field value
@@ 256-264 (lines=9) @@
253
     * @param string $fieldValue Field value
254
     * @return object Found object instance or an empty stdClass instance
255
     */
256
    public function fetchField($className, $fieldName, $fieldValue)
257
    {
258
        // Build SQL statement
259
        $sql = 'SELECT *
260
        FROM `'.$className::$_table_name.'`
261
        WHERE `'.$fieldName.'` = '.$this->driver->quote($fieldValue);
262
263
        return $this->fetchOne($sql);
264
    }
265
266
    public function create($className, & $object = null)
267
    {