Code Duplication    Length = 11-12 lines in 2 locations

lib/Author.php 1 location

@@ 83-93 (lines=11) @@
80
        return new Author ($post);
81
    }
82
83
    public static function getAuthorByBookId ($bookId) {
84
        $result = parent::getDb ()->prepare('select authors.id as id, authors.name as name, authors.sort as sort from authors, books_authors_link
85
where author = authors.id
86
and book = ?');
87
        $result->execute (array ($bookId));
88
        $authorArray = array ();
89
        while ($post = $result->fetchObject ()) {
90
            array_push ($authorArray, new Author ($post));
91
        }
92
        return $authorArray;
93
    }
94
}
95

lib/Data.php 1 location

@@ 147-158 (lines=12) @@
144
        return new Link ($href, $this->getMimeType (), Link::OPDS_ACQUISITION_TYPE, $title);
145
    }
146
147
    public static function getDataByBook ($book) {
148
        $out = array ();
149
        $result = parent::getDb ()->prepare('select id, format, name
150
                                             from data where book = ?');
151
        $result->execute (array ($book->id));
152
153
        while ($post = $result->fetchObject ())
154
        {
155
            array_push ($out, new Data ($post, $book));
156
        }
157
        return $out;
158
    }
159
160
    public static function handleThumbnailLink ($urlParam, $height) {
161
        global $config;