Code Duplication    Length = 13-14 lines in 3 locations

core/domain/services/admin/events/editor/EventEntityRelations.php 3 locations

@@ 62-74 (lines=13) @@
59
            [ 'EVT_ID' => $eventId ],
60
            'default_where_conditions' => 'minimum',
61
        ]);
62
        foreach ($datetimeIds as $datetimeId) {
63
            $GID = $this->utilities->convertToGlobalId($this->datetime_model->item_name(), $datetimeId);
64
            foreach ($related_models as $key => $model) {
65
                // Get the IDs of related entities for the datetime ID.
66
                $Ids = $model->get_col([
67
                    [ 'Datetime.DTT_ID' => $datetimeId ],
68
                    'default_where_conditions' => 'minimum',
69
                ]);
70
                $this->data['datetimes'][ $GID ][ $key ] = ! empty($Ids)
71
                    ? $this->utilities->convertToGlobalId($model->item_name(), $Ids)
72
                    : [];
73
            }
74
        }
75
        return $datetimeIds;
76
    }
77
@@ 96-109 (lines=14) @@
93
            [ 'Datetime.DTT_ID' => ['IN', $datetimeIds] ],
94
            'default_where_conditions' => 'minimum',
95
        ]);
96
        foreach ($ticketIds as $ticketId) {
97
            $GID = $this->utilities->convertToGlobalId($this->ticket_model->item_name(), $ticketId);
98
99
            foreach ($related_models as $key => $model) {
100
                // Get the IDs of related entities for the ticket ID.
101
                $Ids = $model->get_col([
102
                    [ 'Ticket.TKT_ID' => $ticketId ],
103
                    'default_where_conditions' => 'minimum',
104
                ]);
105
                $this->data['tickets'][ $GID ][ $key ] = ! empty($Ids)
106
                    ? $this->utilities->convertToGlobalId($model->item_name(), $Ids)
107
                    : [];
108
            }
109
        }
110
        return $ticketIds;
111
    }
112
@@ 141-154 (lines=14) @@
138
            'group_by'                 => 'PRC_ID',
139
            'default_where_conditions' => 'minimum',
140
        ]);
141
        foreach ($priceIds as $priceId) {
142
            $GID = $this->utilities->convertToGlobalId($this->price_model->item_name(), $priceId);
143
144
            foreach ($related_models as $key => $model) {
145
                // Get the IDs of related entities for the price ID.
146
                $Ids = $model->get_col([
147
                    [ 'Price.PRC_ID' => $priceId ],
148
                    'default_where_conditions' => 'minimum',
149
                ]);
150
                $this->data['prices'][ $GID ][ $key ] = ! empty($Ids)
151
                    ? $this->utilities->convertToGlobalId($model->item_name(), $Ids)
152
                    : [];
153
            }
154
        }
155
    }
156
}
157