Code Duplication    Length = 4-9 lines in 3 locations

main/inc/lib/search/tool_processors/document_processor.class.php 1 location

@@ 100-103 (lines=4) @@
97
                // get author
98
                $author = '';
99
                $item_result = Database::query($sql);
100
                if ($row = Database::fetch_array($item_result)) {
101
                    $user_data = api_get_user_info($row['insert_user_id']);
102
                    $author = api_get_person_name($user_data['firstName'], $user_data['lastName']);
103
                }
104
            }
105
            return array($thumbnail, $image, $name, $author, $url); // FIXME: is it posible to get an author here?
106
        } else {

main/inc/lib/search/tool_processors/link_processor.class.php 1 location

@@ 118-121 (lines=4) @@
115
            // get author
116
            $author = '';
117
            $item_result = Database::query($sql);
118
            if ($row = Database::fetch_array($item_result)) {
119
                $user_data = api_get_user_info($row['insert_user_id']);
120
                $author = api_get_person_name($user_data['firstName'], $user_data['lastName']);
121
            }
122
123
            return array($thumbnail, $image, $name, $author, $url);
124
        } else {

main/inc/lib/sessionmanager.lib.php 1 location

@@ 5080-5088 (lines=9) @@
5077
    ) {
5078
        $coaches = self::getCoachesByCourseSession($sessionId, $courseId);
5079
        $list = array();
5080
        if (!empty($coaches)) {
5081
            foreach ($coaches as $coachId) {
5082
                $userInfo = api_get_user_info($coachId);
5083
                $list[] = api_get_person_name(
5084
                    $userInfo['firstname'],
5085
                    $userInfo['lastname']
5086
                );
5087
            }
5088
        }
5089
5090
        return array_to_string($list, CourseManager::USER_SEPARATOR);
5091
    }